Skip to content

Commit

Permalink
fix unsupported method usage in node12
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Jun 16, 2023
1 parent 3d700aa commit 53689cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/build-kmm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ fs.mkdirSync(path.join(process.cwd(), stringsPath), { recursive: true });
const files = fs.readdirSync(process.cwd()).filter(file => /[a-z]{2}-[A-Z]{2}\.json$/g.test(file));

const escape = str => str
.replaceAll('\\', '\\\\')
.replaceAll('"', '\\"')
.replaceAll('\n', '\\n')
.replaceAll('%', '%%')
.replaceAll(/\${\d+}/gm, '%s');
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\n/g, '\\n')
.replace(/%/g, '%%')
.replace(/\$\{\d+}/gm, '%s');

function writeDataClass() {
const defaultTranslation = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'en-US.json')));
Expand Down Expand Up @@ -56,7 +56,7 @@ function writeTranslations() {
}

function toLocaleName(file) {
return fileName(file).replaceAll('-', '_').toUpperCase();
return fileName(file).replace('-', '_').toUpperCase();
}

function fileName(file) {
Expand Down

0 comments on commit 53689cf

Please sign in to comment.