Comparing version 0.1.1 to 0.1.2
@@ -5,2 +5,4 @@ # Changelog | ||
### [0.1.2](https://github.com/nuxt-contrib/destr/compare/v0.1.1...v0.1.2) (2020-05-20) | ||
### 0.1.1 (2020-05-20) |
'use strict'; | ||
// https://github.com/fastify/secure-json-parse | ||
// https://github.com/hapijs/bourne | ||
var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/; | ||
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/; | ||
var STR_MAP = { | ||
@@ -36,5 +40,9 @@ "true": true, | ||
return JSON.parse(val, jsonParseTransform); | ||
if (suspectProtoRx.test(val) || suspectConstructorRx.test(val)) { | ||
return JSON.parse(val, jsonParseTransform); | ||
} | ||
return JSON.parse(val); | ||
} | ||
module.exports = destr; |
{ | ||
"name": "destr", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"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
6736
42