Socket
Socket
Sign inDemoInstall

@babel/helper-define-polyfill-provider

Package Overview
Dependencies
65
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0 to 0.4.1

13

lib/browser/dependencies.js

@@ -8,17 +8,16 @@ "use strict";

exports.resolve = resolve;
function resolve(dirname, moduleName, absoluteImports) {
if (absoluteImports === false) return moduleName;
throw new Error(`"absoluteImports" is not supported in bundles prepared for the browser.`);
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function has(basedir, name) {
return true;
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function logMissing(missingDeps) {}
function logMissing(missingDeps) {} // eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function laterLogMissing(missingDeps) {}

@@ -7,14 +7,10 @@ "use strict";

exports.stringifyTargetsMultiline = stringifyTargetsMultiline;
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
const presetEnvSilentDebugHeader = "#__secret_key__@babel/preset-env__don't_log_debug_header_and_resolved_targets";
exports.presetEnvSilentDebugHeader = presetEnvSilentDebugHeader;
function stringifyTargetsMultiline(targets) {
return JSON.stringify((0, _helperCompilationTargets.prettifyTargets)(targets), null, 2);
}
function stringifyTargets(targets) {
return JSON.stringify(targets).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }');
}

@@ -5,6 +5,6 @@ "use strict";

exports.defineProvider = defineProvider;
function defineProvider(factory) {
// This will allow us to do some things
return factory;
}

@@ -5,13 +5,8 @@ "use strict";

exports.default = void 0;
var _babel = _interopRequireWildcard(require("@babel/core"));
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; }
const {
types: t
} = _babel.default || _babel;
class ImportsCache {

@@ -24,21 +19,15 @@ constructor(resolver) {

}
storeAnonymous(programPath, url, // eslint-disable-next-line no-undef
storeAnonymous(programPath, url,
// eslint-disable-next-line no-undef
getVal) {
const key = this._normalizeKey(programPath, url);
const imports = this._ensure(this._anonymousImports, programPath, Set);
if (imports.has(key)) return;
const node = getVal(programPath.node.sourceType === "script", t.stringLiteral(this._resolver(url)));
imports.add(key);
this._injectImport(programPath, node);
}
storeNamed(programPath, url, name, getVal) {
const key = this._normalizeKey(programPath, url, name);
const imports = this._ensure(this._imports, programPath, Map);
if (!imports.has(key)) {

@@ -50,15 +39,11 @@ const {

imports.set(key, id);
this._injectImport(programPath, node);
}
return t.identifier(imports.get(key));
}
_injectImport(programPath, node) {
const lastImport = this._lastImports.get(programPath);
let newNodes;
if (lastImport && lastImport.node && // Sometimes the AST is modified and the "last import"
if (lastImport && lastImport.node &&
// Sometimes the AST is modified and the "last import"
// we have has been replaced

@@ -70,6 +55,5 @@ lastImport.parent === programPath.node && lastImport.container === programPath.node.body) {

}
const newNode = newNodes[newNodes.length - 1];
this._lastImports.set(programPath, newNode);
this._lastImports.set(programPath, newNode);
/*

@@ -95,3 +79,2 @@ let lastImport;

});*/
}

@@ -101,3 +84,2 @@

let collection = map.get(programPath);
if (!collection) {

@@ -107,18 +89,15 @@ collection = new Collection();

}
return collection;
}
_normalizeKey(programPath, url, name = "") {
const {
sourceType
} = programPath.node; // If we rely on the imported binding (the "name" parameter), we also need to cache
} = programPath.node;
// If we rely on the imported binding (the "name" parameter), we also need to cache
// based on the sourceType. This is because the module transforms change the names
// of the import variables.
return `${name && sourceType}::${url}::${name}`;
}
}
exports.default = ImportsCache;

@@ -5,45 +5,28 @@ "use strict";

exports.default = definePolyfillProvider;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperCompilationTargets = _interopRequireWildcard(require("@babel/helper-compilation-targets"));
var _utils = require("./utils");
var _importsCache = _interopRequireDefault(require("./imports-cache"));
var _debugUtils = require("./debug-utils");
var _normalizeOptions = require("./normalize-options");
var v = _interopRequireWildcard(require("./visitors"));
var deps = _interopRequireWildcard(require("./node/dependencies"));
var _metaResolver = _interopRequireDefault(require("./meta-resolver"));
const _excluded = ["method", "targets", "ignoreBrowserslistConfig", "configPath", "debug", "shouldInjectPolyfill", "absoluteImports"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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 _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
const getTargets = _helperCompilationTargets.default.default || _helperCompilationTargets.default;
function resolveOptions(options, babelApi) {
const {
method,
targets: targetsOption,
ignoreBrowserslistConfig,
configPath,
debug,
shouldInjectPolyfill,
absoluteImports
} = options,
providerOptions = _objectWithoutPropertiesLoose(options, _excluded);
method,
targets: targetsOption,
ignoreBrowserslistConfig,
configPath,
debug,
shouldInjectPolyfill,
absoluteImports
} = options,
providerOptions = _objectWithoutPropertiesLoose(options, _excluded);
if (isEmpty(options)) {

@@ -60,3 +43,2 @@ throw new Error(`\

}
let methodName;

@@ -68,3 +50,2 @@ if (method === "usage-global") methodName = "usageGlobal";else if (method === "entry-global") methodName = "entryGlobal";else if (method === "usage-pure") methodName = "usagePure";else if (typeof method !== "string") {

}
if (typeof shouldInjectPolyfill === "function") {

@@ -77,10 +58,8 @@ if (options.include || options.exclude) {

}
if (absoluteImports != null && typeof absoluteImports !== "boolean" && typeof absoluteImports !== "string") {
throw new Error(`.absoluteImports must be a boolean, a string, or undefined` + ` (received ${JSON.stringify(absoluteImports)})`);
}
let targets;
if ( // If any browserslist-related option is specified, fallback to the old
if (
// If any browserslist-related option is specified, fallback to the old
// behavior of not using the targets specified in the top-level options.

@@ -98,3 +77,2 @@ targetsOption || configPath || ignoreBrowserslistConfig) {

}
return {

@@ -110,3 +88,2 @@ method,

}
function instantiateProvider(factory, options, missingDependencies, dirname, debugLog, babelApi) {

@@ -122,4 +99,5 @@ const {

} = resolveOptions(options, babelApi);
const getUtils = (0, _utils.createUtilsGetter)(new _importsCache.default(moduleName => deps.resolve(dirname, moduleName, absoluteImports))); // eslint-disable-next-line prefer-const
const getUtils = (0, _utils.createUtilsGetter)(new _importsCache.default(moduleName => deps.resolve(dirname, moduleName, absoluteImports)));
// eslint-disable-next-line prefer-const
let include, exclude;

@@ -136,3 +114,2 @@ let polyfillsSupport;

createMetaResolver: _metaResolver.default,
shouldInjectPolyfill(name) {

@@ -142,7 +119,5 @@ if (polyfillsNames === undefined) {

}
if (!polyfillsNames.has(name)) {
console.warn(`Internal error in the ${providerName} provider: ` + `unknown polyfill "${name}".`);
}
if (filterPolyfills && !filterPolyfills(name)) return false;

@@ -154,6 +129,4 @@ let shouldInject = (0, _helperCompilationTargets.isRequired)(name, targets, {

});
if (shouldInjectPolyfill) {
shouldInject = shouldInjectPolyfill(name, shouldInject);
if (typeof shouldInject !== "boolean") {

@@ -163,9 +136,6 @@ throw new Error(`.shouldInjectPolyfill must return a boolean.`);

}
return shouldInject;
},
debug(name) {
var _debugLog, _debugLog$polyfillsSu;
debugLog().found = true;

@@ -177,6 +147,4 @@ if (!debug || !name) return;

},
assertDependency(name, version = "*") {
if (missingDependencies === false) return;
if (absoluteImports) {

@@ -188,6 +156,4 @@ // If absoluteImports is not false, we will try resolving

}
const dep = version === "*" ? name : `${name}@^${version}`;
const found = missingDependencies.all ? false : mapGetOr(depsCache, `${name} :: ${dirname}`, () => deps.has(dirname, name));
if (!found) {

@@ -197,11 +163,8 @@ debugLog().missingDeps.add(dep);

}
};
const provider = factory(api, providerOptions, dirname);
const providerName = provider.name || factory.name;
if (typeof provider[methodName] !== "function") {
throw new Error(`The "${providerName}" provider doesn't support the "${method}" polyfilling method.`);
}
if (Array.isArray(provider.polyfills)) {

@@ -217,3 +180,2 @@ polyfillsNames = new Set(provider.polyfills);

}
({

@@ -229,3 +191,2 @@ include,

providerName,
callProvider(payload, path) {

@@ -235,6 +196,4 @@ const utils = getUtils(path);

}
};
}
function definePolyfillProvider(factory) {

@@ -258,3 +217,2 @@ return (0, _helperPluginUtils.declare)((babelApi, options, dirname) => {

const visitor = provider.visitor ? traverse.visitors.merge([createVisitor(callProvider), provider.visitor]) : createVisitor(callProvider);
if (debug && debug !== _debugUtils.presetEnvSilentDebugHeader) {

@@ -265,3 +223,2 @@ console.log(`${providerName}: \`DEBUG\` option`);

}
const {

@@ -273,6 +230,4 @@ runtimeName

visitor,
pre(file) {
var _provider$pre;
if (runtimeName) {

@@ -286,3 +241,2 @@ if (file.get("runtimeHelpersModuleName") && file.get("runtimeHelpersModuleName") !== runtimeName) {

}
debugLog = {

@@ -297,8 +251,5 @@ polyfills: new Set(),

},
post() {
var _provider$post;
(_provider$post = provider.post) == null ? void 0 : _provider$post.apply(this, arguments);
if (missingDependencies !== false) {

@@ -311,6 +262,4 @@ if (missingDependencies.log === "per-file") {

}
if (!debug) return;
if (this.filename) console.log(`\n[${this.filename}]`);
if (debugLog.polyfills.size === 0) {

@@ -320,3 +269,2 @@ console.log(method === "entry-global" ? debugLog.found ? `Based on your targets, the ${providerName} polyfill did not add any polyfill.` : `The entry point for the ${providerName} polyfill has not been found.` : `Based on your code and targets, the ${providerName} polyfill did not add any polyfill.`);

}
if (method === "entry-global") {

@@ -327,6 +275,4 @@ console.log(`The ${providerName} polyfill entry has been replaced with ` + `the following polyfills:`);

}
for (const name of debugLog.polyfills) {
var _debugLog$polyfillsSu2;
if ((_debugLog$polyfillsSu2 = debugLog.polyfillsSupport) != null && _debugLog$polyfillsSu2[name]) {

@@ -341,10 +287,7 @@ const filteredTargets = (0, _helperCompilationTargets.getInclusionReasons)(name, targets, debugLog.polyfillsSupport);

}
};
});
}
function mapGetOr(map, key, getDefault) {
let val = map.get(key);
if (val === undefined) {

@@ -354,8 +297,6 @@ val = getDefault();

}
return val;
}
function isEmpty(obj) {
return Object.keys(obj).length === 0;
}

@@ -5,7 +5,4 @@ "use strict";

exports.default = createMetaResolver;
var _utils = require("./utils");
const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
function createMetaResolver(polyfills) {

@@ -25,3 +22,2 @@ const {

}
if (meta.kind === "property" || meta.kind === "in") {

@@ -33,3 +29,2 @@ const {

} = meta;
if (object && placement === "static") {

@@ -43,3 +38,2 @@ if (globalP && PossibleGlobalObjects.has(object) && (0, _utils.has)(globalP, key)) {

}
if (staticP && (0, _utils.has)(staticP, object) && (0, _utils.has)(staticP[object], key)) {

@@ -53,3 +47,2 @@ return {

}
if (instanceP && (0, _utils.has)(instanceP, key)) {

@@ -56,0 +49,0 @@ return {

@@ -8,16 +8,10 @@ "use strict";

exports.resolve = resolve;
var _path = _interopRequireDefault(require("path"));
var _lodash = _interopRequireDefault(require("lodash.debounce"));
var _resolve = _interopRequireDefault(require("resolve"));
var _module = require("module");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const nativeRequireResolve = parseFloat(process.versions.node) >= 8.9;
// eslint-disable-line
// eslint-disable-line
function myResolve(name, basedir) {

@@ -34,11 +28,8 @@ if (nativeRequireResolve) {

}
function resolve(dirname, moduleName, absoluteImports) {
if (absoluteImports === false) return moduleName;
let basedir = dirname;
if (typeof absoluteImports === "string") {
basedir = _path.default.resolve(basedir, absoluteImports);
}
try {

@@ -55,3 +46,2 @@ return myResolve(moduleName, basedir);

}
function has(basedir, name) {

@@ -65,3 +55,2 @@ try {

}
function logMissing(missingDeps) {

@@ -73,3 +62,2 @@ if (missingDeps.size === 0) return;

}
let allMissingDeps = new Set();

@@ -80,3 +68,2 @@ const laterLogMissingDependencies = (0, _lodash.default)(() => {

}, 100);
function laterLogMissing(missingDeps) {

@@ -83,0 +70,0 @@ if (missingDeps.size === 0) return;

@@ -6,8 +6,5 @@ "use strict";

exports.validateIncludeExclude = validateIncludeExclude;
var _utils = require("./utils");
function patternToRegExp(pattern) {
if (pattern instanceof RegExp) return pattern;
try {

@@ -19,3 +16,2 @@ return new RegExp(`^${pattern}$`);

}
function buildUnusedError(label, unused) {

@@ -25,3 +21,2 @@ if (!unused.length) return "";

}
function buldDuplicatesError(duplicates) {

@@ -31,6 +26,4 @@ if (!duplicates.size) return "";

}
function validateIncludeExclude(provider, polyfills, includePatterns, excludePatterns) {
let current;
const filter = pattern => {

@@ -40,3 +33,2 @@ const regexp = patternToRegExp(pattern);

let matched = false;
for (const polyfill of polyfills) {

@@ -48,18 +40,16 @@ if (regexp.test(polyfill)) {

}
return !matched;
}; // prettier-ignore
};
// prettier-ignore
const include = current = new Set();
const unusedInclude = Array.from(includePatterns).filter(filter); // prettier-ignore
const unusedInclude = Array.from(includePatterns).filter(filter);
// prettier-ignore
const exclude = current = new Set();
const unusedExclude = Array.from(excludePatterns).filter(filter);
const duplicates = (0, _utils.intersection)(include, exclude);
if (duplicates.size > 0 || unusedInclude.length > 0 || unusedExclude.length > 0) {
throw new Error(`Error while validating the "${provider}" provider options:\n` + buildUnusedError("include", unusedInclude) + buildUnusedError("exclude", unusedExclude) + buldDuplicatesError(duplicates));
}
return {

@@ -70,3 +60,2 @@ include,

}
function applyMissingDependenciesDefaults(options, babelApi) {

@@ -73,0 +62,0 @@ const {

@@ -11,9 +11,5 @@ "use strict";

exports.resolveSource = resolveSource;
var _babel = _interopRequireWildcard(require("@babel/core"));
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; }
const {

@@ -23,3 +19,2 @@ types: t,

} = _babel.default || _babel;
function intersection(a, b) {

@@ -30,22 +25,15 @@ const result = new Set();

}
function has(object, key) {
return Object.prototype.hasOwnProperty.call(object, key);
}
function getType(target) {
return Object.prototype.toString.call(target).slice(8, -1);
}
function resolveId(path) {
if (path.isIdentifier() && !path.scope.hasBinding(path.node.name,
/* noGlobals */
true)) {
if (path.isIdentifier() && !path.scope.hasBinding(path.node.name, /* noGlobals */true)) {
return path.node.name;
}
const {
deopt
} = path.evaluate();
if (deopt && deopt.isIdentifier()) {

@@ -55,3 +43,2 @@ return deopt.node.name;

}
function resolveKey(path, computed = false) {

@@ -63,19 +50,12 @@ const {

const isIdentifier = path.isIdentifier();
if (isIdentifier && !(computed || path.parent.computed)) {
return path.node.name;
}
if (computed && path.isMemberExpression() && path.get("object").isIdentifier({
name: "Symbol"
}) && !scope.hasBinding("Symbol",
/* noGlobals */
true)) {
}) && !scope.hasBinding("Symbol", /* noGlobals */true)) {
const sym = resolveKey(path.get("property"), path.node.computed);
if (sym) return "Symbol." + sym;
}
if (!isIdentifier || scope.hasBinding(path.node.name,
/* noGlobals */
true)) {
if (!isIdentifier || scope.hasBinding(path.node.name, /* noGlobals */true)) {
const {

@@ -87,3 +67,2 @@ value

}
function resolveSource(obj) {

@@ -94,3 +73,2 @@ if (obj.isMemberExpression() && obj.get("property").isIdentifier({

const id = resolveId(obj.get("object"));
if (id) {

@@ -102,3 +80,2 @@ return {

}
return {

@@ -109,5 +86,3 @@ id: null,

}
const id = resolveId(obj);
if (id) {

@@ -119,7 +94,5 @@ return {

}
const {
value
} = obj.evaluate();
if (value !== undefined) {

@@ -141,3 +114,2 @@ return {

}
return {

@@ -148,3 +120,2 @@ id: null,

}
function getImportSource({

@@ -155,3 +126,2 @@ node

}
function getRequireSource({

@@ -164,3 +134,2 @@ node

} = node;
if (t.isCallExpression(expression) && t.isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && t.isStringLiteral(expression.arguments[0])) {

@@ -170,3 +139,2 @@ return expression.arguments[0].value;

}
function hoist(node) {

@@ -177,3 +145,2 @@ // @ts-expect-error

}
function createUtilsGetter(cache) {

@@ -188,3 +155,2 @@ return path => {

},
injectNamedImport(url, name, hint = name) {

@@ -201,3 +167,2 @@ return cache.storeNamed(prog, url, name, (isScript, source, name) => {

},
injectDefaultImport(url, hint = url) {

@@ -212,5 +177,4 @@ return cache.storeNamed(prog, url, "default", (isScript, source) => {

}
};
};
}

@@ -5,5 +5,3 @@ "use strict";

exports.default = void 0;
var _utils = require("../utils");
var _default = callProvider => ({

@@ -18,3 +16,2 @@ ImportDeclaration(path) {

},
Program(path) {

@@ -30,5 +27,3 @@ path.get("body").forEach(bodyPath => {

}
});
exports.default = _default;

@@ -5,11 +5,6 @@ "use strict";

exports.usage = exports.entry = void 0;
var _usage = _interopRequireDefault(require("./usage"));
exports.usage = _usage.default;
var _entry = _interopRequireDefault(require("./entry"));
exports.entry = _entry.default;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -5,5 +5,3 @@ "use strict";

exports.default = void 0;
var _utils = require("../utils");
var _default = callProvider => {

@@ -18,3 +16,2 @@ function property(object, key, placement, path) {

}
return {

@@ -35,3 +32,2 @@ // Symbol(), new Promise

},
MemberExpression(path) {

@@ -41,3 +37,2 @@ const key = (0, _utils.resolveKey)(path.get("property"), path.node.computed);

const object = path.get("object");
if (object.isIdentifier()) {

@@ -47,7 +42,5 @@ const binding = object.scope.getBinding(object.node.name);

}
const source = (0, _utils.resolveSource)(object);
return property(source.id, key, source.placement, path);
},
ObjectPattern(path) {

@@ -58,12 +51,14 @@ const {

} = path;
let obj; // const { keys, values } = Object
let obj;
// const { keys, values } = Object
if (parentPath.isVariableDeclarator()) {
obj = parentPath.get("init"); // ({ keys, values } = Object)
obj = parentPath.get("init");
// ({ keys, values } = Object)
} else if (parentPath.isAssignmentExpression()) {
obj = parentPath.get("right"); // !function ({ keys, values }) {...} (Object)
obj = parentPath.get("right");
// !function ({ keys, values }) {...} (Object)
// resolution does not work after properties transform :-(
} else if (parentPath.isFunction()) {
const grand = parentPath.parentPath;
if (grand.isCallExpression() || grand.isNewExpression()) {

@@ -75,3 +70,2 @@ if (grand.node.callee === parent) {

}
let id = null;

@@ -83,3 +77,2 @@ let placement = null;

} = (0, _utils.resolveSource)(obj));
for (const prop of path.get("properties")) {

@@ -92,3 +85,2 @@ if (prop.isObjectProperty()) {

},
BinaryExpression(path) {

@@ -106,6 +98,4 @@ if (path.node.operator !== "in") return;

}
};
};
exports.default = _default;
{
"name": "@babel/helper-define-polyfill-provider",
"version": "0.4.0",
"version": "0.4.1",
"description": "Babel helper to create your own polyfill provider",

@@ -36,8 +36,7 @@ "repository": {

"dependencies": {
"@babel/helper-compilation-targets": "^7.17.7",
"@babel/helper-plugin-utils": "^7.16.7",
"@babel/helper-compilation-targets": "^7.22.6",
"@babel/helper-plugin-utils": "^7.22.5",
"debug": "^4.1.1",
"lodash.debounce": "^4.0.8",
"resolve": "^1.14.2",
"semver": "^6.1.2"
"resolve": "^1.14.2"
},

@@ -48,7 +47,7 @@ "peerDependencies": {

"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/generator": "^7.17.7",
"@babel/plugin-transform-modules-commonjs": "^7.17.7",
"@babel/traverse": "^7.17.3",
"@babel/cli": "^7.22.6",
"@babel/core": "^7.22.6",
"@babel/generator": "^7.22.5",
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
"@babel/traverse": "^7.22.6",
"babel-loader": "^8.1.0",

@@ -61,3 +60,3 @@ "rollup": "^2.3.2",

},
"gitHead": "391a1f4049fe1d6943ca8e91cf7e2e23f3f1ef73"
"gitHead": "74956db5d547985ac8e60bf1af56f4c61af12e4e"
}

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

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