Afanasev_Stepan_PIbd-21_IP/ИП 3 лаба/node_modules/es-abstract/operations/build-unicode.mjs
[USERNAME] 0dd26716dc Lab2-5
2024-01-10 16:11:49 +04:00

20 lines
460 B
JavaScript

import fs from 'fs';
import path from 'path';
import C from '@unicode/unicode-15.0.0/Case_Folding/C/symbols.js';
import S from '@unicode/unicode-15.0.0/Case_Folding/S/symbols.js';
function normalize(map) {
return Object.fromEntries(Array.from(map, ([o, i]) => [i, [].concat(o)[0]]));
}
const cases = {
C: normalize(C),
S: normalize(S),
};
fs.writeFileSync(
path.join(process.cwd(), './helpers/caseFolding.json'),
JSON.stringify(cases, null, '\t'),
);