babel-plugin-transform-numeric-separator
Advanced tools
Comparing version 7.0.0-alpha.15 to 7.0.0-alpha.16
@@ -8,6 +8,2 @@ "use strict"; | ||
function replacer(value) { | ||
return value.replace(/_/g, ""); | ||
} | ||
function replaceNumberArg(_ref2) { | ||
@@ -19,23 +15,23 @@ var node = _ref2.node; | ||
} | ||
var arg = node.arguments[0]; | ||
if (!t.isStringLiteral(arg)) { | ||
return; | ||
} | ||
arg.value = replacer(arg.value); | ||
arg.value = arg.value.replace(/_/g, ""); | ||
} | ||
var CallExpression = replaceNumberArg; | ||
var NewExpression = replaceNumberArg; | ||
return { | ||
inherits: _babelPluginSyntaxNumericSeparator2.default, | ||
visitor: { | ||
CallExpression: CallExpression, | ||
NewExpression: NewExpression, | ||
CallExpression: replaceNumberArg, | ||
NewExpression: replaceNumberArg, | ||
NumericLiteral: function NumericLiteral(_ref3) { | ||
var node = _ref3.node; | ||
var extra = node.extra; | ||
if (node.extra && /_/.test(node.extra.raw)) { | ||
node.value = replacer(node.extra.raw); | ||
if (extra && /_/.test(extra.raw)) { | ||
extra.raw = extra.raw.replace(/_/g, ""); | ||
} | ||
@@ -42,0 +38,0 @@ } |
{ | ||
"name": "babel-plugin-transform-numeric-separator", | ||
"version": "7.0.0-alpha.15", | ||
"version": "7.0.0-alpha.16", | ||
"description": "Remove numeric separators from Decimal, Binary, Hex and Octal literals", | ||
@@ -12,7 +12,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-numeric-separator", | ||
"dependencies": { | ||
"babel-plugin-syntax-numeric-separator": "7.0.0-alpha.15" | ||
"babel-plugin-syntax-numeric-separator": "7.0.0-alpha.16" | ||
}, | ||
"devDependencies": { | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.15" | ||
"babel-helper-plugin-test-runner": "7.0.0-alpha.16" | ||
} | ||
} |
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
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
4172
32
+ Addedbabel-plugin-syntax-numeric-separator@7.0.0-alpha.16(transitive)
- Removedbabel-plugin-syntax-numeric-separator@7.0.0-alpha.15(transitive)