@jest/transform
Advanced tools
+2
-2
@@ -137,2 +137,3 @@ /** | ||
| shouldTransform(filename: string): boolean; | ||
| canTransformSync(filename: string): boolean; | ||
| } | ||
@@ -153,2 +154,3 @@ | ||
| sourcesRelatedToTestsInChangedFiles?: Set<string>; | ||
| globalRootDir?: string; | ||
| } | ||
@@ -239,3 +241,1 @@ | ||
| export declare type TransformResult = TransformTypes.TransformResult; | ||
| export {}; |
+21
-11
@@ -23,5 +23,5 @@ /*! | ||
| exports.createTranspilingRequire = createTranspilingRequire; | ||
| function _crypto() { | ||
| const data = require("crypto"); | ||
| _crypto = function () { | ||
| function _nodeCrypto() { | ||
| const data = require("node:crypto"); | ||
| _nodeCrypto = function () { | ||
| return data; | ||
@@ -32,3 +32,3 @@ }; | ||
| function path() { | ||
| const data = _interopRequireWildcard(require("path")); | ||
| const data = _interopRequireWildcard(require("node:path")); | ||
| path = function () { | ||
@@ -168,5 +168,5 @@ return data; | ||
| if (transformerCacheKey != null) { | ||
| return (0, _crypto().createHash)('sha1').update(transformerCacheKey).update(CACHE_VERSION).digest('hex').slice(0, 32); | ||
| return (0, _nodeCrypto().createHash)('sha1').update(transformerCacheKey).update(CACHE_VERSION).digest('hex').slice(0, 32); | ||
| } | ||
| return (0, _crypto().createHash)('sha1').update(fileData).update(transformOptions.configString).update(transformOptions.instrument ? 'instrument' : '').update(filename).update(CACHE_VERSION).digest('hex').slice(0, 32); | ||
| return (0, _nodeCrypto().createHash)('sha1').update(fileData).update(transformOptions.configString).update(transformOptions.instrument ? 'instrument' : '').update(filename).update(CACHE_VERSION).digest('hex').slice(0, 32); | ||
| } | ||
@@ -633,2 +633,12 @@ _buildTransformCacheKey(pattern, filepath) { | ||
| } | ||
| canTransformSync(filename) { | ||
| if (!this.shouldTransform(filename)) { | ||
| return true; | ||
| } | ||
| const transformerEntry = this._getTransformer(filename); | ||
| if (transformerEntry == null) { | ||
| return true; | ||
| } | ||
| return typeof transformerEntry.transformer.process === 'function'; | ||
| } | ||
| } | ||
@@ -675,3 +685,3 @@ async function createTranspilingRequire(config) { | ||
| function writeCodeCacheFile(cachePath, code) { | ||
| const checksum = (0, _crypto().createHash)('sha1').update(code).digest('hex').slice(0, 32); | ||
| const checksum = (0, _nodeCrypto().createHash)('sha1').update(code).digest('hex').slice(0, 32); | ||
| writeCacheFile(cachePath, `${checksum}\n${code}`); | ||
@@ -692,3 +702,3 @@ } | ||
| const code = content.slice(33); | ||
| const checksum = (0, _crypto().createHash)('sha1').update(code).digest('hex').slice(0, 32); | ||
| const checksum = (0, _nodeCrypto().createHash)('sha1').update(code).digest('hex').slice(0, 32); | ||
| if (checksum === content.slice(0, 32)) { | ||
@@ -918,3 +928,3 @@ return code; | ||
| function path() { | ||
| const data = _interopRequireWildcard(require("path")); | ||
| const data = _interopRequireWildcard(require("node:path")); | ||
| path = function () { | ||
@@ -979,3 +989,3 @@ return data; | ||
| // still cover if `only` is specified | ||
| options.collectCoverageFrom.length > 0 && !(0, _jestUtil().globsToMatcher)(options.collectCoverageFrom)((0, _jestUtil().replacePathSepForGlob)(path().relative(config.rootDir, filename)))) { | ||
| options.collectCoverageFrom.length > 0 && !(0, _jestUtil().globsToMatcher)(options.collectCoverageFrom)((0, _jestUtil().replacePathSepForGlob)(path().relative(options.globalRootDir ?? config.rootDir, filename)))) { | ||
| return false; | ||
@@ -1020,3 +1030,3 @@ } | ||
| module.exports = /*#__PURE__*/JSON.parse('{"name":"@jest/transform","version":"30.2.0","repository":{"type":"git","url":"https://github.com/jestjs/jest.git","directory":"packages/jest-transform"},"license":"MIT","main":"./build/index.js","types":"./build/index.d.ts","exports":{".":{"types":"./build/index.d.ts","require":"./build/index.js","import":"./build/index.mjs","default":"./build/index.js"},"./package.json":"./package.json"},"dependencies":{"@babel/core":"^7.27.4","@jest/types":"workspace:*","@jridgewell/trace-mapping":"^0.3.25","babel-plugin-istanbul":"^7.0.1","chalk":"^4.1.2","convert-source-map":"^2.0.0","fast-json-stable-stringify":"^2.1.0","graceful-fs":"^4.2.11","jest-haste-map":"workspace:*","jest-regex-util":"workspace:*","jest-util":"workspace:*","pirates":"^4.0.7","slash":"^3.0.0","write-file-atomic":"^5.0.1"},"devDependencies":{"@jest/test-utils":"workspace:*","@types/babel__core":"^7.20.5","@types/convert-source-map":"^2.0.3","@types/graceful-fs":"^4.1.9","@types/write-file-atomic":"^4.0.3","dedent":"^1.6.0"},"engines":{"node":"^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"},"publishConfig":{"access":"public"}}'); | ||
| module.exports = {"version":"30.3.0"}; | ||
@@ -1023,0 +1033,0 @@ /***/ } |
+7
-7
| { | ||
| "name": "@jest/transform", | ||
| "version": "30.3.0", | ||
| "version": "30.4.0", | ||
| "repository": { | ||
@@ -23,3 +23,3 @@ "type": "git", | ||
| "@babel/core": "^7.27.4", | ||
| "@jest/types": "30.3.0", | ||
| "@jest/types": "30.4.0", | ||
| "@jridgewell/trace-mapping": "^0.3.25", | ||
@@ -31,5 +31,5 @@ "babel-plugin-istanbul": "^7.0.1", | ||
| "graceful-fs": "^4.2.11", | ||
| "jest-haste-map": "30.3.0", | ||
| "jest-regex-util": "30.0.1", | ||
| "jest-util": "30.3.0", | ||
| "jest-haste-map": "30.4.0", | ||
| "jest-regex-util": "30.4.0", | ||
| "jest-util": "30.4.0", | ||
| "pirates": "^4.0.7", | ||
@@ -40,3 +40,3 @@ "slash": "^3.0.0", | ||
| "devDependencies": { | ||
| "@jest/test-utils": "30.3.0", | ||
| "@jest/test-utils": "30.4.0", | ||
| "@types/babel__core": "^7.20.5", | ||
@@ -54,3 +54,3 @@ "@types/convert-source-map": "^2.0.3", | ||
| }, | ||
| "gitHead": "efb59c2e81083f8dc941f20d6d20a3af2dc8d068" | ||
| "gitHead": "5cbb21e0b3037edb42e503ec1a1ce80efad40c20" | ||
| } |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1270
0.55%1
-50%51756
-1.31%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated