@tramvai/safe-strings
Advanced tools
Comparing version 0.5.5 to 0.5.6
@@ -55,2 +55,6 @@ import reduce from '@tinkoff/utils/array/reduce'; | ||
const safeParseJSON = (str, defaultValue = null) => { | ||
// old version of node has memory leak if use json.parse with undefined value https://github.com/nodejs/node/issues/33266#issuecomment-638532113 | ||
if (str === undefined) { | ||
return defaultValue; | ||
} | ||
try { | ||
@@ -57,0 +61,0 @@ return JSON.parse(str); |
@@ -63,2 +63,6 @@ 'use strict'; | ||
const safeParseJSON = (str, defaultValue = null) => { | ||
// old version of node has memory leak if use json.parse with undefined value https://github.com/nodejs/node/issues/33266#issuecomment-638532113 | ||
if (str === undefined) { | ||
return defaultValue; | ||
} | ||
try { | ||
@@ -65,0 +69,0 @@ return JSON.parse(str); |
{ | ||
"name": "@tramvai/safe-strings", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/utils.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7891
191