]> git.ardis.lu - csvio/commitdiff
Freeze ErrorStrategies and use null prototype
authorArdis Lu <ardisglu@gmail.com>
Fri, 21 Feb 2025 06:43:01 +0000 (22:43 -0800)
committerArdis Lu <ardisglu@gmail.com>
Fri, 21 Feb 2025 06:43:01 +0000 (22:43 -0800)
This configuration is the most restrictive and fit for its intended purpose as a namespace only.

src/errorStrategies.js

index 46dd80591c935913bf1246ee2284d5f9441871ed..7550a03afc4a03128fb42295eac007da6644c6a0 100644 (file)
@@ -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
This page took 0.056707 seconds and 4 git commands to generate.