index.js (babel-7.12.6) | : | index.js (babel-7.12.7) | ||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator"; | import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator"; | |||
/** | /** | |||
* Given a bigIntLiteral or NumericLiteral, remove numeric | * Given a bigIntLiteral or NumericLiteral, remove numeric | |||
* separator `_` from its raw representation | * separator `_` from its raw representation | |||
* | * | |||
* @param {NodePath<BigIntLiteral | NumericLiteral>} { node }: A Babel AST node path | * @param {NodePath<BigIntLiteral | NumericLiteral>} { node }: A Babel AST node path | |||
*/ | */ | |||
function remover({ node }: NodePath<BigIntLiteral | NumericLiteral>) { | function remover({ node }: NodePath<BigIntLiteral | NumericLiteral>) { | |||
const { extra } = node; | const { extra } = node; | |||
if (extra && extra.raw.includes("_")) { | if (extra?.raw?.includes("_")) { | |||
extra.raw = extra.raw.replace(/_/g, ""); | extra.raw = extra.raw.replace(/_/g, ""); | |||
} | } | |||
} | } | |||
export default declare(api => { | export default declare(api => { | |||
api.assertVersion(7); | api.assertVersion(7); | |||
return { | return { | |||
name: "proposal-numeric-separator", | name: "proposal-numeric-separator", | |||
inherits: syntaxNumericSeparator, | inherits: syntaxNumericSeparator, | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |