@babel/register
Advanced tools
+0
-1
@@ -25,3 +25,2 @@ "use strict"; | ||
| } | ||
| ; | ||
| function compile(client, inputCode, filename) { | ||
@@ -28,0 +27,0 @@ const result = client.transform(inputCode, filename); |
+1
-3
| "use strict"; | ||
| { | ||
| module.exports = require("./experimental-worker.cjs"); | ||
| } | ||
| module.exports = require("./experimental-worker.cjs"); | ||
| //# sourceMappingURL=index.cjs.map |
@@ -5,3 +5,4 @@ "use strict"; | ||
| const envVarValue = "yes_I_am"; | ||
| const markInRegisterWorker = env => Object.assign({}, env, { | ||
| const markInRegisterWorker = env => ({ | ||
| ...env, | ||
| [envVarName]: envVarValue | ||
@@ -8,0 +9,0 @@ }); |
+3
-1
@@ -9,3 +9,5 @@ "use strict"; | ||
| function register(opts = {}) { | ||
| return hook.register(client, Object.assign({}, opts)); | ||
| return hook.register(client, { | ||
| ...opts | ||
| }); | ||
| } | ||
@@ -12,0 +14,0 @@ module.exports = Object.assign(register, { |
@@ -58,4 +58,3 @@ "use strict"; | ||
| }; | ||
| ; | ||
| //# sourceMappingURL=worker-client.cjs.map |
@@ -11,9 +11,6 @@ "use strict"; | ||
| exports.getEnv = babel.getEnv; | ||
| ; | ||
| cache.initializeCacheFilename(); | ||
| } | ||
| { | ||
| exports.init = import("@babel/core").then(initialize); | ||
| } | ||
| exports.init = import("@babel/core").then(initialize); | ||
| //# sourceMappingURL=babel-core.cjs.map |
@@ -15,3 +15,2 @@ "use strict"; | ||
| case "TRANSFORM_SYNC": | ||
| ; | ||
| } | ||
@@ -18,0 +17,0 @@ throw new Error(`Unknown internal parser worker action: ${action}`); |
@@ -21,3 +21,5 @@ "use strict"; | ||
| error, | ||
| errorData: Object.assign({}, error) | ||
| errorData: { | ||
| ...error | ||
| } | ||
| }; | ||
@@ -24,0 +26,0 @@ } |
+15
-13
@@ -24,7 +24,9 @@ "use strict"; | ||
| delete opts.extensions; | ||
| transformOpts = Object.assign({}, opts, { | ||
| caller: Object.assign({ | ||
| name: "@babel/register" | ||
| }, opts.caller || {}) | ||
| }); | ||
| transformOpts = { | ||
| ...opts, | ||
| caller: { | ||
| name: "@babel/register", | ||
| ...(opts.caller || {}) | ||
| } | ||
| }; | ||
| let { | ||
@@ -41,7 +43,7 @@ cwd = "." | ||
| async function transform(input, filename) { | ||
| const opts = await babel.loadOptionsAsync(Object.assign({ | ||
| sourceRoot: path.dirname(filename) + path.sep | ||
| }, cloneDeep(transformOpts), { | ||
| const opts = await babel.loadOptionsAsync({ | ||
| sourceRoot: path.dirname(filename) + path.sep, | ||
| ...cloneDeep(transformOpts), | ||
| filename | ||
| })); | ||
| }); | ||
| if (opts === null) return null; | ||
@@ -56,6 +58,7 @@ const { | ||
| map | ||
| } = await babel.transformAsync(input, Object.assign({}, opts, { | ||
| } = await babel.transformAsync(input, { | ||
| ...opts, | ||
| sourceMaps: opts.sourceMaps === undefined ? "both" : opts.sourceMaps, | ||
| ast: false | ||
| })); | ||
| }); | ||
| return store({ | ||
@@ -70,3 +73,2 @@ code, | ||
| }; | ||
| ; | ||
| const id = value => value; | ||
@@ -83,3 +85,3 @@ function cacheLookup(opts, filename) { | ||
| const fileMtime = +fs.statSync(filename).mtime; | ||
| if (cached && cached.mtime === fileMtime) { | ||
| if (cached?.mtime === fileMtime) { | ||
| return { | ||
@@ -86,0 +88,0 @@ cached: cached.value, |
+8
-5
| { | ||
| "name": "@babel/register", | ||
| "version": "8.0.0-beta.3", | ||
| "version": "8.0.0-beta.4", | ||
| "description": "babel require hook", | ||
@@ -24,8 +24,8 @@ "license": "MIT", | ||
| "peerDependencies": { | ||
| "@babel/core": "^8.0.0-beta.3" | ||
| "@babel/core": "^7.0.0-0" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^8.0.0-beta.3", | ||
| "@babel/plugin-transform-arrow-functions": "^8.0.0-beta.3", | ||
| "@babel/plugin-transform-modules-commonjs": "^8.0.0-beta.3", | ||
| "@babel/core": "^8.0.0-beta.4", | ||
| "@babel/plugin-transform-arrow-functions": "^8.0.0-beta.4", | ||
| "@babel/plugin-transform-modules-commonjs": "^8.0.0-beta.4", | ||
| "browserify": "^16.5.2" | ||
@@ -44,3 +44,6 @@ }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "browser": { | ||
| "./lib/index.cjs": "./lib/browser.cjs" | ||
| } | ||
| } |
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
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
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
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
49137
-6.69%454
-0.22%