Updating NPM dependencies
This commit is contained in:
41
node_modules/resolve/lib/async.js
generated
vendored
41
node_modules/resolve/lib/async.js
generated
vendored
@@ -1,9 +1,11 @@
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var caller = require('./caller.js');
|
||||
var nodeModulesPaths = require('./node-modules-paths.js');
|
||||
var normalizeOptions = require('./normalize-options.js');
|
||||
var isCore = require('./is-core');
|
||||
var caller = require('./caller');
|
||||
var nodeModulesPaths = require('./node-modules-paths');
|
||||
var normalizeOptions = require('./normalize-options');
|
||||
var isCore = require('is-core-module');
|
||||
|
||||
var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
|
||||
|
||||
var defaultIsFile = function isFile(file, cb) {
|
||||
fs.stat(file, function (err, stat) {
|
||||
@@ -25,12 +27,16 @@ var defaultIsDir = function isDirectory(dir, cb) {
|
||||
});
|
||||
};
|
||||
|
||||
var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts, cb) {
|
||||
var defaultRealpath = function realpath(x, cb) {
|
||||
realpathFS(x, function (realpathErr, realPath) {
|
||||
if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
|
||||
else cb(null, realpathErr ? x : realPath);
|
||||
});
|
||||
};
|
||||
|
||||
var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
|
||||
if (opts && opts.preserveSymlinks === false) {
|
||||
fs.realpath(x, function (realPathErr, realPath) {
|
||||
if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);
|
||||
else cb(null, realPathErr ? x : realPath);
|
||||
});
|
||||
realpath(x, cb);
|
||||
} else {
|
||||
cb(null, x);
|
||||
}
|
||||
@@ -63,9 +69,11 @@ module.exports = function resolve(x, options, callback) {
|
||||
var isFile = opts.isFile || defaultIsFile;
|
||||
var isDirectory = opts.isDirectory || defaultIsDir;
|
||||
var readFile = opts.readFile || fs.readFile;
|
||||
var realpath = opts.realpath || defaultRealpath;
|
||||
var packageIterator = opts.packageIterator;
|
||||
|
||||
var extensions = opts.extensions || ['.js'];
|
||||
var includeCoreModules = opts.includeCoreModules !== false;
|
||||
var basedir = opts.basedir || path.dirname(caller());
|
||||
var parent = opts.filename || basedir;
|
||||
|
||||
@@ -74,7 +82,8 @@ module.exports = function resolve(x, options, callback) {
|
||||
// ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
|
||||
var absoluteStart = path.resolve(basedir);
|
||||
|
||||
maybeUnwrapSymlink(
|
||||
maybeRealpath(
|
||||
realpath,
|
||||
absoluteStart,
|
||||
opts,
|
||||
function (err, realStart) {
|
||||
@@ -87,16 +96,16 @@ module.exports = function resolve(x, options, callback) {
|
||||
function init(basedir) {
|
||||
if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
|
||||
res = path.resolve(basedir, x);
|
||||
if (x === '..' || x.slice(-1) === '/') res += '/';
|
||||
if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
|
||||
if ((/\/$/).test(x) && res === basedir) {
|
||||
loadAsDirectory(res, opts.package, onfile);
|
||||
} else loadAsFile(res, opts.package, onfile);
|
||||
} else if (isCore(x)) {
|
||||
} else if (includeCoreModules && isCore(x)) {
|
||||
return cb(null, x);
|
||||
} else loadNodeModules(x, basedir, function (err, n, pkg) {
|
||||
if (err) cb(err);
|
||||
else if (n) {
|
||||
return maybeUnwrapSymlink(n, opts, function (err, realN) {
|
||||
return maybeRealpath(realpath, n, opts, function (err, realN) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
} else {
|
||||
@@ -117,7 +126,7 @@ module.exports = function resolve(x, options, callback) {
|
||||
else loadAsDirectory(res, function (err, d, pkg) {
|
||||
if (err) cb(err);
|
||||
else if (d) {
|
||||
maybeUnwrapSymlink(d, opts, function (err, realD) {
|
||||
maybeRealpath(realpath, d, opts, function (err, realD) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
} else {
|
||||
@@ -181,7 +190,7 @@ module.exports = function resolve(x, options, callback) {
|
||||
}
|
||||
if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null);
|
||||
|
||||
maybeUnwrapSymlink(dir, opts, function (unwrapErr, pkgdir) {
|
||||
maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
|
||||
if (unwrapErr) return loadpkg(path.dirname(dir), cb);
|
||||
var pkgfile = path.join(pkgdir, 'package.json');
|
||||
isFile(pkgfile, function (err, ex) {
|
||||
@@ -209,7 +218,7 @@ module.exports = function resolve(x, options, callback) {
|
||||
fpkg = opts.package;
|
||||
}
|
||||
|
||||
maybeUnwrapSymlink(x, opts, function (unwrapErr, pkgdir) {
|
||||
maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
|
||||
if (unwrapErr) return cb(unwrapErr);
|
||||
var pkgfile = path.join(pkgdir, 'package.json');
|
||||
isFile(pkgfile, function (err, ex) {
|
||||
|
||||
4
node_modules/resolve/lib/core.js
generated
vendored
4
node_modules/resolve/lib/core.js
generated
vendored
@@ -6,8 +6,8 @@ function specifierIncluded(specifier) {
|
||||
var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
|
||||
|
||||
for (var i = 0; i < 3; ++i) {
|
||||
var cur = Number(current[i] || 0);
|
||||
var ver = Number(versionParts[i] || 0);
|
||||
var cur = parseInt(current[i] || 0, 10);
|
||||
var ver = parseInt(versionParts[i] || 0, 10);
|
||||
if (cur === ver) {
|
||||
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
||||
}
|
||||
|
||||
11
node_modules/resolve/lib/core.json
generated
vendored
11
node_modules/resolve/lib/core.json
generated
vendored
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"assert": true,
|
||||
"assert/strict": ">= 15",
|
||||
"async_hooks": ">= 8",
|
||||
"buffer_ieee754": "< 0.9.7",
|
||||
"buffer": true,
|
||||
@@ -11,12 +12,14 @@
|
||||
"_debug_agent": ">= 1 && < 8",
|
||||
"_debugger": "< 8",
|
||||
"dgram": true,
|
||||
"diagnostics_channel": ">= 15.1",
|
||||
"dns": true,
|
||||
"domain": true,
|
||||
"dns/promises": ">= 15",
|
||||
"domain": ">= 0.7.12",
|
||||
"events": true,
|
||||
"freelist": "< 6",
|
||||
"fs": true,
|
||||
"fs/promises": ">= 10 && < 10.1",
|
||||
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
||||
"_http_agent": ">= 0.11.1",
|
||||
"_http_client": ">= 0.11.1",
|
||||
"_http_common": ">= 0.11.1",
|
||||
@@ -49,9 +52,11 @@
|
||||
"_stream_readable": ">= 0.9.4",
|
||||
"_stream_writable": ">= 0.9.4",
|
||||
"stream": true,
|
||||
"stream/promises": ">= 15",
|
||||
"string_decoder": true,
|
||||
"sys": true,
|
||||
"sys": [">= 0.6 && < 0.7", ">= 0.8"],
|
||||
"timers": true,
|
||||
"timers/promises": ">= 15",
|
||||
"_tls_common": ">= 0.11.13",
|
||||
"_tls_legacy": ">= 0.11.3 && < 10",
|
||||
"_tls_wrap": ">= 0.11.3",
|
||||
|
||||
4
node_modules/resolve/lib/is-core.js
generated
vendored
4
node_modules/resolve/lib/is-core.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
var core = require('./core');
|
||||
var isCoreModule = require('is-core-module');
|
||||
|
||||
module.exports = function isCore(x) {
|
||||
return Object.prototype.hasOwnProperty.call(core, x);
|
||||
return isCoreModule(x);
|
||||
};
|
||||
|
||||
47
node_modules/resolve/lib/sync.js
generated
vendored
47
node_modules/resolve/lib/sync.js
generated
vendored
@@ -1,9 +1,11 @@
|
||||
var isCore = require('./is-core');
|
||||
var isCore = require('is-core-module');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var caller = require('./caller.js');
|
||||
var nodeModulesPaths = require('./node-modules-paths.js');
|
||||
var normalizeOptions = require('./normalize-options.js');
|
||||
var caller = require('./caller');
|
||||
var nodeModulesPaths = require('./node-modules-paths');
|
||||
var normalizeOptions = require('./normalize-options');
|
||||
|
||||
var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
|
||||
|
||||
var defaultIsFile = function isFile(file) {
|
||||
try {
|
||||
@@ -25,19 +27,24 @@ var defaultIsDir = function isDirectory(dir) {
|
||||
return stat.isDirectory();
|
||||
};
|
||||
|
||||
var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts) {
|
||||
if (opts && opts.preserveSymlinks === false) {
|
||||
try {
|
||||
return fs.realpathSync(x);
|
||||
} catch (realPathErr) {
|
||||
if (realPathErr.code !== 'ENOENT') {
|
||||
throw realPathErr;
|
||||
}
|
||||
var defaultRealpathSync = function realpathSync(x) {
|
||||
try {
|
||||
return realpathFS(x);
|
||||
} catch (realpathErr) {
|
||||
if (realpathErr.code !== 'ENOENT') {
|
||||
throw realpathErr;
|
||||
}
|
||||
}
|
||||
return x;
|
||||
};
|
||||
|
||||
var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
|
||||
if (opts && opts.preserveSymlinks === false) {
|
||||
return realpathSync(x);
|
||||
}
|
||||
return x;
|
||||
};
|
||||
|
||||
var getPackageCandidates = function getPackageCandidates(x, start, opts) {
|
||||
var dirs = nodeModulesPaths(start, opts, x);
|
||||
for (var i = 0; i < dirs.length; i++) {
|
||||
@@ -55,27 +62,29 @@ module.exports = function resolveSync(x, options) {
|
||||
var isFile = opts.isFile || defaultIsFile;
|
||||
var readFileSync = opts.readFileSync || fs.readFileSync;
|
||||
var isDirectory = opts.isDirectory || defaultIsDir;
|
||||
var realpathSync = opts.realpathSync || defaultRealpathSync;
|
||||
var packageIterator = opts.packageIterator;
|
||||
|
||||
var extensions = opts.extensions || ['.js'];
|
||||
var includeCoreModules = opts.includeCoreModules !== false;
|
||||
var basedir = opts.basedir || path.dirname(caller());
|
||||
var parent = opts.filename || basedir;
|
||||
|
||||
opts.paths = opts.paths || [];
|
||||
|
||||
// ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
|
||||
var absoluteStart = maybeUnwrapSymlink(path.resolve(basedir), opts);
|
||||
var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
|
||||
|
||||
if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
|
||||
var res = path.resolve(absoluteStart, x);
|
||||
if (x === '..' || x.slice(-1) === '/') res += '/';
|
||||
if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
|
||||
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
||||
if (m) return maybeUnwrapSymlink(m, opts);
|
||||
} else if (isCore(x)) {
|
||||
if (m) return maybeRealpathSync(realpathSync, m, opts);
|
||||
} else if (includeCoreModules && isCore(x)) {
|
||||
return x;
|
||||
} else {
|
||||
var n = loadNodeModulesSync(x, absoluteStart);
|
||||
if (n) return maybeUnwrapSymlink(n, opts);
|
||||
if (n) return maybeRealpathSync(realpathSync, n, opts);
|
||||
}
|
||||
|
||||
var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
||||
@@ -112,7 +121,7 @@ module.exports = function resolveSync(x, options) {
|
||||
}
|
||||
if ((/[/\\]node_modules[/\\]*$/).test(dir)) return;
|
||||
|
||||
var pkgfile = path.join(maybeUnwrapSymlink(dir, opts), 'package.json');
|
||||
var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');
|
||||
|
||||
if (!isFile(pkgfile)) {
|
||||
return loadpkg(path.dirname(dir));
|
||||
@@ -133,7 +142,7 @@ module.exports = function resolveSync(x, options) {
|
||||
}
|
||||
|
||||
function loadAsDirectorySync(x) {
|
||||
var pkgfile = path.join(maybeUnwrapSymlink(x, opts), '/package.json');
|
||||
var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
|
||||
if (isFile(pkgfile)) {
|
||||
try {
|
||||
var body = readFileSync(pkgfile, 'UTF8');
|
||||
|
||||
Reference in New Issue
Block a user