Socket
Socket
Sign inDemoInstall

metro-transform-plugins

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-transform-plugins - npm Package Compare versions

Comparing version 0.60.0 to 0.61.0

4

package.json
{
"name": "metro-transform-plugins",
"version": "0.60.0",
"version": "0.61.0",
"description": "🚇 Transform plugins for Metro",

@@ -25,4 +25,4 @@ "main": "src/index.js",

"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"metro": "0.60.0"
"metro": "0.61.0"
}
}

@@ -14,3 +14,2 @@ /**

var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {

@@ -24,3 +23,2 @@ var symbols = Object.getOwnPropertySymbols(object);

}
return keys;

@@ -32,3 +30,2 @@ }

var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {

@@ -50,3 +47,2 @@ ownKeys(Object(source), true).forEach(function(key) {

}
return target;

@@ -66,3 +62,2 @@ }

}
return obj;

@@ -69,0 +64,0 @@ }

@@ -48,5 +48,3 @@ /**

if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;

@@ -57,3 +55,2 @@ }

var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {

@@ -67,3 +64,2 @@ var symbols = Object.getOwnPropertySymbols(object);

}
return keys;

@@ -75,3 +71,2 @@ }

var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {

@@ -93,3 +88,2 @@ ownKeys(Object(source), true).forEach(function(key) {

}
return target;

@@ -109,3 +103,2 @@ }

}
return obj;

@@ -118,2 +111,3 @@ }

expression = _require.expression;
/**

@@ -124,3 +118,2 @@ * Produces a Babel template that transforms an "import * as x from ..." or an

*/
const importTemplate = template(`

@@ -192,4 +185,5 @@ var LOCAL = IMPORT(FILE);

});
} // eslint-disable-next-line no-redeclare
}
// eslint-disable-next-line no-redeclare
function withLocation(node, loc) {

@@ -409,8 +403,7 @@ if (Array.isArray(node)) {

const specifiers = path.get("specifiers");
const anchor = path.scope.path.get("body.0");
const loc = path.node.loc;
if (!specifiers.length) {
anchor.insertBefore(
withLocation(
state.imports.push({
node: withLocation(
importSideEffectTemplate({

@@ -421,3 +414,3 @@ FILE: resolvePath(file, state.opts.resolve)

)
);
});
} else {

@@ -453,4 +446,4 @@ let sharedModuleImport = null;

case "ImportNamespaceSpecifier":
anchor.insertBefore(
withLocation(
state.imports.push({
node: withLocation(
importTemplate({

@@ -463,8 +456,8 @@ IMPORT: state.importAll,

)
);
});
break;
case "ImportDefaultSpecifier":
anchor.insertBefore(
withLocation(
state.imports.push({
node: withLocation(
importTemplate({

@@ -477,3 +470,3 @@ IMPORT: state.importDefault,

)
);
});
break;

@@ -483,4 +476,4 @@

if (imported.name === "default") {
anchor.insertBefore(
withLocation(
state.imports.push({
node: withLocation(
importTemplate({

@@ -493,3 +486,3 @@ IMPORT: state.importDefault,

)
);
});
} else if (sharedModuleImport != null) {

@@ -504,4 +497,4 @@ path.scope.push({

} else {
anchor.insertBefore(
withLocation(
state.imports.push({
node: withLocation(
importNamedTemplate({

@@ -514,3 +507,3 @@ FILE: resolvePath(file, state.opts.resolve),

)
);
});
}

@@ -534,2 +527,3 @@

state.exportNamed = [];
state.imports = [];
state.importAll = t.identifier(state.opts.importAll);

@@ -540,3 +534,8 @@ state.importDefault = t.identifier(state.opts.importDefault);

exit(path, state) {
const body = path.node.body;
const body = path.node.body; // state.imports = [node1, node2, node3, ...nodeN]
state.imports.reverse().forEach(e => {
// import nodes are added to the top of the program body
body.unshift(e.node);
});
state.exportDefault.forEach(e => {

@@ -543,0 +542,0 @@ body.push(

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc