From ab435435f18af3ff7c8b997e859e760bcc9b951a Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 20 Feb 2025 22:43:01 -0800 Subject: [PATCH] Freeze ErrorStrategies and use null prototype This configuration is the most restrictive and fit for its intended purpose as a namespace only. --- src/errorStrategies.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/errorStrategies.js b/src/errorStrategies.js index 46dd805..7550a03 100644 --- a/src/errorStrategies.js +++ b/src/errorStrategies.js @@ -77,4 +77,9 @@ function backoff(iterations, maxExponent, value) { } } -export const ErrorStrategies = { placeholder, retry, backoff }; \ No newline at end of file +export const ErrorStrategies = Object.create(null, { + placeholder: { value: placeholder }, + retry: { value: retry }, + backoff: { value: backoff } +}); +Object.freeze(ErrorStrategies); \ No newline at end of file -- 2.47.3