Comparing version 0.1.6 to 0.1.7
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.1.7](https://github.com/nuxt-contrib/destr/compare/v0.1.6...v0.1.7) (2020-05-27) | ||
### Bug Fixes | ||
* don't throw error on parse fail ([65e22c6](https://github.com/nuxt-contrib/destr/commit/65e22c631ef2757d0b25d77e1270f4656bca7ef8)) | ||
### [0.1.6](https://github.com/nuxt-contrib/destr/compare/v0.1.5...v0.1.6) (2020-05-27) | ||
@@ -7,0 +14,0 @@ |
@@ -52,9 +52,13 @@ 'use strict'; | ||
if (suspectProtoRx.test(val) || suspectConstructorRx.test(val)) { | ||
return JSON.parse(val, jsonParseTransform); | ||
try { | ||
if (suspectProtoRx.test(val) || suspectConstructorRx.test(val)) { | ||
return JSON.parse(val, jsonParseTransform); | ||
} | ||
return JSON.parse(val); | ||
} catch (_e) { | ||
return val; | ||
} | ||
return JSON.parse(val); | ||
} | ||
module.exports = destr; |
{ | ||
"name": "destr", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "A faster, secure and convenient alternative for JSON.parse", | ||
@@ -5,0 +5,0 @@ "repository": "nuxt-contrib/destr", |
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
7742
53