Skip to content

Commit

Permalink
Fix: replace all function
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto authored Aug 28, 2021
1 parent 5a0fe09 commit 2ac7e4d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Lib/helper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@ function convertJsonForDefine(json, prefix) {
};
const replaceIdentifier = (identifier) =>
identifier
.replaceAll("..", ".")
.replaceAll("-", "_")
.replaceAll("0", "ZERO")
.replaceAll("1", "ONE")
.replaceAll("2", "TWO")
.replaceAll("3", "THREE")
.replaceAll("4", "FOUR")
.replaceAll("5", "FIVE")
.replaceAll("6", "SIX")
.replaceAll("7", "SEVEN")
.replaceAll("8", "EIGHT")
.replaceAll("9", "NINE");
.replace(/\.\./g, ".")
.replace(/-/g, "_")
.replace(/0/g, "ZERO")
.replace(/1/g, "ONE")
.replace(/2/g, "TWO")
.replace(/3/g, "THREE")
.replace(/4/g, "FOUR")
.replace(/5/g, "FIVE")
.replace(/6/g, "SIX")
.replace(/7/g, "SEVEN")
.replace(/8/g, "EIGHT")
.replace(/9/g, "NINE");

const checkIdentifier = (identifier) => !identifier.match(/[:\d\/\+\$\\\*\[\]]/gi);

Expand Down

0 comments on commit 2ac7e4d

Please sign in to comment.