Adding includes fix for plugin-proposal-numeric-separator (#12311)

Co-authored-by: fraywing <austin@rupie.io>
This commit is contained in:
Austin Anderson 2020-11-04 11:20:04 -08:00 committed by GitHub
parent 12c6db6fae
commit ddf30ee233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator";
*/
function remover({ node }: NodePath<BigIntLiteral | NumericLiteral>) {
const { extra } = node;
if (extra && extra.raw.includes("_")) {
if (extra?.raw?.includes("_")) {
extra.raw = extra.raw.replace(/_/g, "");
}
}