snyk-try-require
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -25,4 +25,12 @@ module.exports = tryRequire; | ||
.then(function (pkgStr) { | ||
var leadingBOM = ''; | ||
if (pkgStr && pkgStr[0] === '\ufeff') { | ||
// String starts with UTF BOM. Remove it so that JSON.parse doesn't | ||
// stumble, but remember it for later use. | ||
pkgStr = pkgStr.slice(1); | ||
leadingBOM = '\ufeff'; | ||
} | ||
var pkg = JSON.parse(pkgStr); | ||
pkg.leading = pkgStr.match(/^(\s*){/)[1]; | ||
pkg.leading = leadingBOM + pkgStr.match(/^(\s*){/)[1]; | ||
pkg.trailing = pkgStr.match(/}(\s*)$/)[1]; | ||
@@ -29,0 +37,0 @@ return pkg; |
@@ -37,3 +37,3 @@ { | ||
}, | ||
"version": "1.3.0" | ||
"version": "1.3.1" | ||
} |
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
28506
88