@babel/register
Advanced tools
+16
-18
@@ -25,20 +25,18 @@ "use strict"; | ||
| } | ||
| { | ||
| const Module = require("module"); | ||
| let compiling = false; | ||
| const internalModuleCache = Module._cache; | ||
| var compileBabel7 = function compileBabel7(client, code, filename) { | ||
| if (!client.isLocalClient) return compile(client, code, filename); | ||
| if (compiling) return code; | ||
| const globalModuleCache = Module._cache; | ||
| try { | ||
| compiling = true; | ||
| Module._cache = internalModuleCache; | ||
| return compile(client, code, filename); | ||
| } finally { | ||
| compiling = false; | ||
| Module._cache = globalModuleCache; | ||
| } | ||
| }; | ||
| } | ||
| const Module = require("module"); | ||
| let compiling = false; | ||
| const internalModuleCache = Module._cache; | ||
| var compileBabel7 = function compileBabel7(client, code, filename) { | ||
| if (!client.isLocalClient) return compile(client, code, filename); | ||
| if (compiling) return code; | ||
| const globalModuleCache = Module._cache; | ||
| try { | ||
| compiling = true; | ||
| Module._cache = internalModuleCache; | ||
| return compile(client, code, filename); | ||
| } finally { | ||
| compiling = false; | ||
| Module._cache = globalModuleCache; | ||
| } | ||
| }; | ||
| function compile(client, inputCode, filename) { | ||
@@ -45,0 +43,0 @@ const result = client.transform(inputCode, filename); |
+7
-9
| "use strict"; | ||
| { | ||
| exports = module.exports = function () { | ||
| return register.apply(this, arguments); | ||
| }; | ||
| exports.__esModule = true; | ||
| const node = require("./nodeWrapper.cjs"); | ||
| const register = node.default; | ||
| Object.assign(exports, node); | ||
| } | ||
| exports = module.exports = function () { | ||
| return register.apply(this, arguments); | ||
| }; | ||
| exports.__esModule = true; | ||
| const node = require("./nodeWrapper.cjs"); | ||
| const register = node.default; | ||
| Object.assign(exports, node); | ||
| //# sourceMappingURL=index.cjs.map |
+13
-15
| "use strict"; | ||
| var _LocalClient, _handleMessage; | ||
| function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); } | ||
@@ -68,18 +69,15 @@ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } | ||
| }; | ||
| { | ||
| var _LocalClient, _handleMessage; | ||
| module.exports.LocalClient = (_LocalClient = class LocalClient extends Client { | ||
| constructor() { | ||
| var _assertClassBrand$_; | ||
| (_assertClassBrand$_ = _assertClassBrand(_LocalClient, LocalClient, _handleMessage)._) != null ? _assertClassBrand$_ : _handleMessage._ = _assertClassBrand(_LocalClient, LocalClient, require("./worker/handle-message.cjs")); | ||
| super((action, payload) => { | ||
| return _assertClassBrand(_LocalClient, LocalClient, _handleMessage)._.call(LocalClient, action === ACTIONS.TRANSFORM ? ACTIONS.TRANSFORM_SYNC : action, payload); | ||
| }); | ||
| this.isLocalClient = true; | ||
| } | ||
| }, _handleMessage = { | ||
| _: void 0 | ||
| }, _LocalClient); | ||
| } | ||
| module.exports.LocalClient = (_LocalClient = class LocalClient extends Client { | ||
| constructor() { | ||
| var _assertClassBrand$_; | ||
| (_assertClassBrand$_ = _assertClassBrand(_LocalClient, LocalClient, _handleMessage)._) != null ? _assertClassBrand$_ : _handleMessage._ = _assertClassBrand(_LocalClient, LocalClient, require("./worker/handle-message.cjs")); | ||
| super((action, payload) => { | ||
| return _assertClassBrand(_LocalClient, LocalClient, _handleMessage)._.call(LocalClient, action === ACTIONS.TRANSFORM ? ACTIONS.TRANSFORM_SYNC : action, payload); | ||
| }); | ||
| this.isLocalClient = true; | ||
| } | ||
| }, _handleMessage = { | ||
| _: void 0 | ||
| }, _LocalClient); | ||
| //# sourceMappingURL=worker-client.cjs.map |
@@ -11,12 +11,8 @@ "use strict"; | ||
| exports.getEnv = babel.getEnv; | ||
| { | ||
| exports.OptionManager = babel.OptionManager; | ||
| exports.transformSync = babel.transformSync; | ||
| } | ||
| exports.OptionManager = babel.OptionManager; | ||
| exports.transformSync = babel.transformSync; | ||
| cache.initializeCacheFilename(); | ||
| } | ||
| { | ||
| initialize(require("@babel/core")); | ||
| } | ||
| initialize(require("@babel/core")); | ||
| //# sourceMappingURL=babel-core.cjs.map |
@@ -15,5 +15,3 @@ "use strict"; | ||
| case "TRANSFORM_SYNC": | ||
| { | ||
| return transform.transformSync(payload.code, payload.filename); | ||
| } | ||
| return transform.transformSync(payload.code, payload.filename); | ||
| } | ||
@@ -20,0 +18,0 @@ throw new Error(`Unknown internal parser worker action: ${action}`); |
+25
-27
@@ -75,28 +75,26 @@ "use strict"; | ||
| }; | ||
| { | ||
| module.exports.transformSync = function (input, filename) { | ||
| const opts = new babel.OptionManager().init(Object.assign({ | ||
| sourceRoot: path.dirname(filename) + path.sep | ||
| }, cloneDeep(transformOpts), { | ||
| filename | ||
| })); | ||
| if (opts === null) return null; | ||
| const { | ||
| cached, | ||
| store | ||
| } = cacheLookup(opts, filename); | ||
| if (cached) return cached; | ||
| const { | ||
| code, | ||
| map | ||
| } = babel.transformSync(input, Object.assign({}, opts, { | ||
| sourceMaps: opts.sourceMaps === undefined ? "both" : opts.sourceMaps, | ||
| ast: false | ||
| })); | ||
| return store({ | ||
| code, | ||
| map | ||
| }); | ||
| }; | ||
| } | ||
| module.exports.transformSync = function (input, filename) { | ||
| const opts = new babel.OptionManager().init(Object.assign({ | ||
| sourceRoot: path.dirname(filename) + path.sep | ||
| }, cloneDeep(transformOpts), { | ||
| filename | ||
| })); | ||
| if (opts === null) return null; | ||
| const { | ||
| cached, | ||
| store | ||
| } = cacheLookup(opts, filename); | ||
| if (cached) return cached; | ||
| const { | ||
| code, | ||
| map | ||
| } = babel.transformSync(input, Object.assign({}, opts, { | ||
| sourceMaps: opts.sourceMaps === undefined ? "both" : opts.sourceMaps, | ||
| ast: false | ||
| })); | ||
| return store({ | ||
| code, | ||
| map | ||
| }); | ||
| }; | ||
| const id = value => value; | ||
@@ -113,3 +111,3 @@ function cacheLookup(opts, filename) { | ||
| const fileMtime = +fs.statSync(filename).mtime; | ||
| if (cached && cached.mtime === fileMtime) { | ||
| if ((cached == null ? void 0 : cached.mtime) === fileMtime) { | ||
| return { | ||
@@ -116,0 +114,0 @@ cached: cached.value, |
+3
-3
| { | ||
| "name": "@babel/register", | ||
| "version": "7.28.3", | ||
| "version": "7.28.6", | ||
| "description": "babel require hook", | ||
@@ -28,5 +28,5 @@ "license": "MIT", | ||
| "devDependencies": { | ||
| "@babel/core": "^7.28.3", | ||
| "@babel/core": "^7.28.6", | ||
| "@babel/plugin-transform-arrow-functions": "^7.27.1", | ||
| "@babel/plugin-transform-modules-commonjs": "^7.27.1", | ||
| "@babel/plugin-transform-modules-commonjs": "^7.28.6", | ||
| "browserify": "^16.5.2" | ||
@@ -33,0 +33,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
61399
-0.42%532
-2.56%