From: Ardis Lu Date: Fri, 21 Feb 2025 06:43:01 +0000 (-0800) Subject: Freeze ErrorStrategies and use null prototype X-Git-Tag: v0.1.0~44 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=ab435435f18af3ff7c8b997e859e760bcc9b951a;p=csvio Freeze ErrorStrategies and use null prototype This configuration is the most restrictive and fit for its intended purpose as a namespace only. --- 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