Socket
Socket
Sign inDemoInstall

resolve

Package Overview
Dependencies
Maintainers
2
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 1.12.2 to 1.13.0

lib/is-core.js

5

index.js

@@ -1,5 +0,4 @@

var core = require('./lib/core');
var async = require('./lib/async');
async.core = core;
async.isCore = function isCore(x) { return core[x]; };
async.core = require('./lib/core');
async.isCore = require('./lib/is-core');
async.sync = require('./lib/sync');

@@ -6,0 +5,0 @@

4

lib/async.js

@@ -1,2 +0,1 @@

var core = require('./core');
var fs = require('fs');

@@ -7,2 +6,3 @@ var path = require('path');

var normalizeOptions = require('./normalize-options.js');
var isCore = require('./is-core');

@@ -88,3 +88,3 @@ var defaultIsFile = function isFile(file, cb) {

if (err) cb(err);
else if (core[x]) return cb(null, x);
else if (isCore(x)) return cb(null, x);
else if (n) {

@@ -91,0 +91,0 @@ return maybeUnwrapSymlink(n, opts, function (err, realN) {

@@ -1,2 +0,2 @@

var core = require('./core');
var isCore = require('./is-core');
var fs = require('fs');

@@ -65,3 +65,3 @@ var path = require('path');

if (m) return maybeUnwrapSymlink(m, opts);
} else if (core[x]) {
} else if (isCore(x)) {
return x;

@@ -73,3 +73,3 @@ } else {

if (core[x]) return x;
if (isCore(x)) return x;

@@ -76,0 +76,0 @@ var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");

{
"name": "resolve",
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
"version": "1.12.2",
"version": "1.13.0",
"repository": {

@@ -29,3 +29,3 @@ "type": "git",

"array.prototype.map": "^1.0.1",
"eslint": "^6.6.0",
"eslint": "^6.7.1",
"object-keys": "^1.1.1",

@@ -32,0 +32,0 @@ "safe-publish-latest": "^1.1.4",

@@ -13,2 +13,5 @@ var test = require('tape');

st.ok(!resolve.isCore('../'));
st.ok(!resolve.isCore('toString'));
st.end();

@@ -15,0 +18,0 @@ });

@@ -102,2 +102,6 @@ var path = require('path');

test('packageFilter', function (t) {
function relative(x) {
return path.relative(__dirname, x);
}
function testPackageFilter(preserveSymlinks) {

@@ -122,9 +126,9 @@ return function (st) {

st.equal(
actualPath.replace(__dirname + '/', ''),
preserveSymlinks ? destMain : sourceMain,
relative(actualPath),
path.normalize(preserveSymlinks ? destMain : sourceMain),
'sync: actual path is correct'
);
st.deepEqual(
map(packageFilterPath, function (x) { return x.replace(__dirname + '/', ''); }),
preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg],
map(packageFilterPath, relative),
map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize),
'sync: packageFilter pkgfile arg is correct'

@@ -146,9 +150,9 @@ );

st.equal(
actualPath.replace(__dirname + '/', ''),
preserveSymlinks ? destMain : sourceMain,
relative(actualPath),
path.normalize(preserveSymlinks ? destMain : sourceMain),
'async: actual path is correct'
);
st.deepEqual(
map(asyncPackageFilterPath, function (x) { return x.replace(__dirname + '/', ''); }),
preserveSymlinks ? [destPkg, destPkg, destPkg] : [sourcePkg, sourcePkg, sourcePkg],
map(packageFilterPath, relative),
map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize),
'async: packageFilter pkgfile arg is correct'

@@ -155,0 +159,0 @@ );

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