Socket
Socket
Sign inDemoInstall

jest-resolve

Package Overview
Dependencies
58
Maintainers
3
Versions
271
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 30.0.0-alpha.2 to 30.0.0-alpha.3

38

build/index.js

@@ -320,5 +320,5 @@ /*!

});
} catch (e) {
if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) {
throw e;
} catch (error) {
if (!(error && (error.code === 'ENOENT' || error.code === 'ENOTDIR'))) {
throw error;
}

@@ -503,3 +503,3 @@ }

function nodeModulesPaths(basedir, options) {
const modules = options && options.moduleDirectory ? Array.from(options.moduleDirectory) : ['node_modules'];
const modules = options && options.moduleDirectory ? [...options.moduleDirectory] : ['node_modules'];

@@ -527,3 +527,3 @@ // ensure that `basedir` is an absolute path at this point,

let parsed = path().parse(physicalBasedir);
while (parsed.dir !== paths[paths.length - 1]) {
while (parsed.dir !== paths.at(-1)) {
paths.push(parsed.dir);

@@ -619,4 +619,2 @@ parsed = path().parse(parsed.dir);

/* eslint-disable local/prefer-spread-eventually */
const NATIVE_PLATFORM = 'native';

@@ -688,9 +686,9 @@

moduleDirectory: options.moduleDirectory,
paths: paths ? (nodePaths || []).concat(paths) : nodePaths,
paths: paths ? [...(nodePaths || []), ...paths] : nodePaths,
rootDir: options.rootDir
});
} catch (e) {
} catch (error) {
// we always wanna throw if it's an internal import
if (options.throwIfNotFound || path.startsWith('#')) {
throw e;
throw error;
}

@@ -720,10 +718,10 @@ }

moduleDirectory: options.moduleDirectory,
paths: paths ? (nodePaths || []).concat(paths) : nodePaths,
paths: paths ? [...(nodePaths || []), ...paths] : nodePaths,
rootDir: options.rootDir
});
return result;
} catch (e) {
} catch (error) {
// we always wanna throw if it's an internal import
if (options.throwIfNotFound || path.startsWith('#')) {
throw e;
throw error;
}

@@ -905,3 +903,3 @@ }

const defaultPlatform = this._options.defaultPlatform;
const extensions = this._options.extensions.slice();
const extensions = [...this._options.extensions];
if (this._supportsNativePlatform) {

@@ -930,3 +928,3 @@ extensions.unshift(...this._options.extensions.map(ext => `.${NATIVE_PLATFORM}${ext}`));

if (hastePackage) {
return path().join.apply(path(), [path().dirname(hastePackage)].concat(parts));
return path().join(path().dirname(hastePackage), ...parts);
}

@@ -940,3 +938,3 @@ return null;

_getMapModuleName(matches) {
return matches ? moduleName => moduleName.replace(/\$([0-9]+)/g, (_, index) => matches[parseInt(index, 10)] || '') : moduleName => moduleName;
return matches ? moduleName => moduleName.replaceAll(/\$(\d+)/g, (_, index) => matches[Number.parseInt(index, 10)] || '') : moduleName => moduleName;
}

@@ -1000,3 +998,3 @@ _isAliasModule(moduleName) {

});
if (paths[paths.length - 1] === undefined) {
if (paths.at(-1) === undefined) {
// circumvent node-resolve bug that adds `undefined` as last item.

@@ -1355,3 +1353,3 @@ paths.pop();

const BULLET = _chalk().default.bold('\u25cf ');
const BULLET = _chalk().default.bold('\u25CF ');
const DOCUMENTATION_NOTE = ` ${_chalk().default.bold('Configuration Documentation:')}

@@ -1362,6 +1360,6 @@ https://jestjs.io/docs/configuration

const replaceRootDirInPath = (rootDir, filePath) => {
if (!/^<rootDir>/.test(filePath)) {
if (!filePath.startsWith('<rootDir>')) {
return filePath;
}
return path().resolve(rootDir, path().normalize(`./${filePath.substr('<rootDir>'.length)}`));
return path().resolve(rootDir, path().normalize(`./${filePath.slice('<rootDir>'.length)}`));
};

@@ -1368,0 +1366,0 @@ const resolveWithPrefix = (resolver, {

{
"name": "jest-resolve",
"version": "30.0.0-alpha.2",
"version": "30.0.0-alpha.3",
"repository": {

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

"graceful-fs": "^4.2.9",
"jest-haste-map": "30.0.0-alpha.2",
"jest-haste-map": "30.0.0-alpha.3",
"jest-pnp-resolver": "^1.2.2",
"jest-util": "30.0.0-alpha.2",
"jest-validate": "30.0.0-alpha.2",
"jest-util": "30.0.0-alpha.3",
"jest-validate": "30.0.0-alpha.3",
"resolve": "^1.20.0",

@@ -46,3 +46,3 @@ "resolve.exports": "^2.0.0",

},
"gitHead": "c04d13d7abd22e47b0997f6027886aed225c9ce4"
"gitHead": "e267aff33d105399f2134bad7c8f82285104f3da"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc