metro-react-native-babel-preset
Advanced tools
Comparing version 0.63.0 to 0.64.0
{ | ||
"name": "metro-react-native-babel-preset", | ||
"version": "0.63.0", | ||
"version": "0.64.0", | ||
"description": "Babel preset for React Native applications", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -13,2 +13,3 @@ /** | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
@@ -22,2 +23,3 @@ var symbols = Object.getOwnPropertySymbols(object); | ||
} | ||
return keys; | ||
@@ -29,2 +31,3 @@ } | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
@@ -46,2 +49,3 @@ ownKeys(Object(source), true).forEach(function(key) { | ||
} | ||
return target; | ||
@@ -61,2 +65,3 @@ } | ||
} | ||
return obj; | ||
@@ -101,3 +106,5 @@ } | ||
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; | ||
@@ -131,3 +138,2 @@ } | ||
].concat(_toConsumableArray(passthroughSyntaxPlugins), [ | ||
[require("@babel/plugin-transform-computed-properties")], | ||
[require("@babel/plugin-transform-destructuring")], | ||
@@ -151,2 +157,5 @@ [require("@babel/plugin-transform-function-name")], | ||
]; | ||
const es2015ComputedProperty = [ | ||
require("@babel/plugin-transform-computed-properties") | ||
]; | ||
const es2015Spread = [require("@babel/plugin-transform-spread")]; | ||
@@ -200,2 +209,5 @@ const es2015TemplateLiterals = [ | ||
(options && options.unstable_transformProfile) || "default"; | ||
const isHermesStable = transformProfile === "hermes-stable"; | ||
const isHermesCanary = transformProfile === "hermes-canary"; | ||
const isHermes = isHermesStable || isHermesCanary; | ||
const isNull = src == null; | ||
@@ -237,3 +249,7 @@ const hasClass = isNull || src.indexOf("class") !== -1; | ||
if (isNull || hasClass || src.indexOf("...") !== -1) { | ||
if (!isHermesCanary) { | ||
extraPlugins.push(es2015ComputedProperty); | ||
} | ||
if (!isHermesCanary && (isNull || hasClass || src.indexOf("...") !== -1)) { | ||
extraPlugins.push(es2015Spread); | ||
@@ -243,6 +259,3 @@ extraPlugins.push(objectRestSpread); | ||
if ( | ||
transformProfile !== "hermes-canary" && | ||
(isNull || src.indexOf("`") !== -1) | ||
) { | ||
if (!isHermes && (isNull || src.indexOf("`") !== -1)) { | ||
extraPlugins.push(es2015TemplateLiterals); | ||
@@ -271,7 +284,3 @@ } | ||
if ( | ||
transformProfile !== "hermes-stable" && | ||
transformProfile !== "hermes-canary" && | ||
(isNull || src.indexOf("?.") !== -1) | ||
) { | ||
if (!isHermes && (isNull || src.indexOf("?.") !== -1)) { | ||
extraPlugins.push(optionalChaining); | ||
@@ -284,3 +293,3 @@ } | ||
if (transformProfile !== "hermes-canary") { | ||
if (!isHermes) { | ||
extraPlugins.push(shorthandProperties); | ||
@@ -287,0 +296,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17557
458
1