Socket
Socket
Sign inDemoInstall

resolve

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

test/mock.js

12

index.js

@@ -18,2 +18,6 @@ var fs = require('fs');

if (!opts) opts = {};
var isFile = opts.isFile || function (file) {
return path.existsSync(file) && fs.statSync(file).isFile()
};
var readFileSync = opts.readFileSync || fs.readFileSync;

@@ -37,3 +41,3 @@ var extensions = opts.extensions || [ '.js' ];

function loadAsFileSync (x) {
if (path.existsSync(x) && fs.statSync(x).isFile()) {
if (isFile(x)) {
return x;

@@ -44,3 +48,3 @@ }

var file = x + extensions[i];
if (path.existsSync(file) && fs.statSync(file).isFile()) {
if (isFile(file)) {
return file;

@@ -53,4 +57,4 @@ }

var pkgfile = x + '/package.json';
if (path.existsSync(pkgfile) && fs.statSync(pkgfile).isFile()) {
var body = fs.readFileSync(pkgfile, 'utf8');
if (isFile(pkgfile)) {
var body = readFileSync(pkgfile, 'utf8');
try {

@@ -57,0 +61,0 @@ var pkg = JSON.parse(body);

{
"name" : "resolve",
"description" : "A more hookable require.resolve() implementation",
"version" : "0.0.4",
"version" : "0.1.0",
"repository" : {

@@ -6,0 +6,0 @@ "type" : "git",

Sorry, the diff of this file is not supported yet

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