Socket
Socket
Sign inDemoInstall

snyk-try-require

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-try-require - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

.nyc_output/3352.json

10

lib/try-require.js

@@ -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;

2

package.json

@@ -37,3 +37,3 @@ {

},
"version": "1.3.0"
"version": "1.3.1"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc