Socket
Socket
Sign inDemoInstall

jest-resolve

Package Overview
Dependencies
58
Maintainers
6
Versions
271
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 29.5.0 to 29.6.0

26

build/defaultResolver.js

@@ -80,2 +80,22 @@ 'use strict';

/**
* Allows transforming parsed `package.json` contents.
*
* @param pkg - Parsed `package.json` contents.
* @param file - Path to `package.json` file.
* @param dir - Directory that contains the `package.json`.
*
* @returns Transformed `package.json` contents.
*/
/**
* Allows transforming a path within a package.
*
* @param pkg - Parsed `package.json` contents.
* @param path - Path being resolved.
* @param relativePath - Path relative from the `package.json` location.
*
* @returns Relative path that will be joined from the `package.json` location.
*/
const defaultResolver = (path, options) => {

@@ -96,7 +116,7 @@ // Yarn 2 adds support to `resolve` automatically so the pnpResolver is only

const pathToResolve = getPathInModule(path, resolveOptions);
const result = (0, _resolve().sync)(pathToResolve, resolveOptions);
// Dereference symlinks to ensure we don't create a separate
// resolveSync dereferences symlinks to ensure we don't create a separate
// module instance depending on how it was referenced.
return (0, _fileWalkers.realpathSync)(result);
const result = (0, _resolve().sync)(pathToResolve, resolveOptions);
return result;
};

@@ -103,0 +123,0 @@ var _default = defaultResolver;

6

build/fileWalkers.js

@@ -85,8 +85,8 @@ 'use strict';

}
var IPathType;
(function (IPathType) {
var IPathType = /*#__PURE__*/ (function (IPathType) {
IPathType[(IPathType['FILE'] = 1)] = 'FILE';
IPathType[(IPathType['DIRECTORY'] = 2)] = 'DIRECTORY';
IPathType[(IPathType['OTHER'] = 3)] = 'OTHER';
})(IPathType || (IPathType = {}));
return IPathType;
})(IPathType || {});
const checkedPaths = new Map();

@@ -93,0 +93,0 @@ function statSyncCached(path) {

@@ -102,18 +102,18 @@ 'use strict';

}
const dirs = paths
.reduce(
(dirs, aPath) =>
dirs.concat(
modules.map(moduleDir =>
path().isAbsolute(moduleDir)
? aPath === basedirAbs
? moduleDir
: ''
: path().join(prefix, aPath, moduleDir)
)
),
[]
)
.filter(dir => dir !== '');
return options.paths ? dirs.concat(options.paths) : dirs;
const dirs = paths.reduce((dirs, aPath) => {
for (const moduleDir of modules) {
if (path().isAbsolute(moduleDir)) {
if (aPath === basedirAbs && moduleDir) {
dirs.push(moduleDir);
}
} else {
dirs.push(path().join(prefix, aPath, moduleDir));
}
}
return dirs;
}, []);
if (options.paths) {
dirs.push(...options.paths);
}
return dirs;
}

@@ -120,0 +120,0 @@ function findGlobalPaths() {

{
"name": "jest-resolve",
"version": "29.5.0",
"version": "29.6.0",
"repository": {

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

"graceful-fs": "^4.2.9",
"jest-haste-map": "^29.5.0",
"jest-haste-map": "^29.6.0",
"jest-pnp-resolver": "^1.2.2",
"jest-util": "^29.5.0",
"jest-validate": "^29.5.0",
"jest-util": "^29.6.0",
"jest-validate": "^29.6.0",
"resolve": "^1.20.0",

@@ -32,7 +32,7 @@ "resolve.exports": "^2.0.0",

"devDependencies": {
"@tsd/typescript": "^4.9.0",
"@tsd/typescript": "^5.0.4",
"@types/graceful-fs": "^4.1.3",
"@types/pnpapi": "^0.0.2",
"@types/resolve": "^1.20.2",
"tsd-lite": "^0.6.0"
"tsd-lite": "^0.7.0"
},

@@ -45,3 +45,3 @@ "engines": {

},
"gitHead": "39f3beda6b396665bebffab94e8d7c45be30454c"
"gitHead": "c1e5b8a38ef54bb138409f89831942ebf6a7a67e"
}
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