Socket
Socket
Sign inDemoInstall

jest-resolve-dependencies

Package Overview
Dependencies
154
Maintainers
6
Versions
236
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 29.7.0 to 30.0.0-alpha.1

build/index.mjs

138

build/index.js

@@ -1,9 +0,23 @@

'use strict';
/*!
* /**
* * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* * This source code is licensed under the MIT license found in the
* * LICENSE file in the root directory of this source tree.
* * /
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
(() => {
var exports = __webpack_exports__;
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", ({
value: true
});
}));
exports.DependencyResolver = void 0;
function path() {
const data = _interopRequireWildcard(require('path'));
const data = _interopRequireWildcard(require("path"));
path = function () {

@@ -15,3 +29,3 @@ return data;

function _jestSnapshot() {
const data = require('jest-snapshot');
const data = require("jest-snapshot");
_jestSnapshot = function () {

@@ -22,42 +36,4 @@ return data;

}
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== 'function') return null;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function (nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interopRequireWildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
return {default: obj};
}
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {};
var hasPropertyDescriptor =
Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key in obj) {
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key)
: null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
/**

@@ -95,7 +71,3 @@ * Copyright (c) Meta Platforms, Inc. and affiliates.

try {
resolvedDependency = this._resolver.resolveModule(
file,
dependency,
options
);
resolvedDependency = this._resolver.resolveModule(file, dependency, options);
} catch {

@@ -116,6 +88,3 @@ try {

try {
resolvedMockDependency = this._resolver.getMockModule(
resolvedDependency,
path().basename(dependency)
);
resolvedMockDependency = this._resolver.getMockModule(resolvedDependency, path().basename(dependency));
} catch {

@@ -125,6 +94,3 @@ // leave resolvedMockDependency as undefined if nothing can be found

if (resolvedMockDependency != null) {
const dependencyMockDir = path().resolve(
path().dirname(resolvedDependency),
'__mocks__'
);
const dependencyMockDir = path().resolve(path().dirname(resolvedDependency), '__mocks__');
resolvedMockDependency = path().resolve(resolvedMockDependency);

@@ -141,3 +107,3 @@

resolveInverseModuleMap(paths, filter, options) {
if (!paths.size) {
if (paths.size === 0) {
return [];

@@ -148,28 +114,21 @@ }

const result = [];
while (changed.size) {
changed = new Set(
moduleMap.reduce((acc, module) => {
if (
visitedModules.has(module.file) ||
!module.dependencies.some(dep => changed.has(dep))
) {
return acc;
}
const file = module.file;
if (filter(file)) {
result.push(module);
related.delete(file);
}
visitedModules.add(file);
acc.push(file);
while (changed.size > 0) {
changed = new Set(moduleMap.reduce((acc, module) => {
if (visitedModules.has(module.file) || !module.dependencies.some(dep => changed.has(dep))) {
return acc;
}, [])
);
}
const file = module.file;
if (filter(file)) {
result.push(module);
related.delete(file);
}
visitedModules.add(file);
acc.push(file);
return acc;
}, []));
}
return result.concat(
Array.from(related).map(file => ({
dependencies: [],
file
}))
);
return result.concat(Array.from(related).map(file => ({
dependencies: [],
file
})));
};

@@ -180,5 +139,3 @@ const relatedPaths = new Set();

if (this._hasteFS.exists(path)) {
const modulePath = (0, _jestSnapshot().isSnapshotPath)(path)
? this._snapshotResolver.resolveTestPath(path)
: path;
const modulePath = (0, _jestSnapshot().isSnapshotPath)(path) ? this._snapshotResolver.resolveTestPath(path) : path;
changed.add(modulePath);

@@ -200,7 +157,10 @@ if (filter(modulePath)) {

resolveInverse(paths, filter, options) {
return this.resolveInverseModuleMap(paths, filter, options).map(
module => module.file
);
return this.resolveInverseModuleMap(paths, filter, options).map(module => module.file);
}
}
exports.DependencyResolver = DependencyResolver;
})();
module.exports = __webpack_exports__;
/******/ })()
;
{
"name": "jest-resolve-dependencies",
"version": "29.7.0",
"version": "30.0.0-alpha.1",
"repository": {

@@ -15,2 +15,4 @@ "type": "git",

"types": "./build/index.d.ts",
"require": "./build/index.js",
"import": "./build/index.mjs",
"default": "./build/index.js"

@@ -21,14 +23,14 @@ },

"dependencies": {
"jest-regex-util": "^29.6.3",
"jest-snapshot": "^29.7.0"
"jest-regex-util": "30.0.0-alpha.1",
"jest-snapshot": "30.0.0-alpha.1"
},
"devDependencies": {
"@jest/test-utils": "^29.7.0",
"@jest/types": "^29.6.3",
"jest-haste-map": "^29.7.0",
"jest-resolve": "^29.7.0",
"jest-runtime": "^29.7.0"
"@jest/test-utils": "30.0.0-alpha.1",
"@jest/types": "30.0.0-alpha.1",
"jest-haste-map": "30.0.0-alpha.1",
"jest-resolve": "30.0.0-alpha.1",
"jest-runtime": "30.0.0-alpha.1"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
},

@@ -38,3 +40,3 @@ "publishConfig": {

},
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630"
"gitHead": "d005cb2505c041583e0c5636d006e08666a54b63"
}
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