Skip to content

Commit

Permalink
feat: support unicode 15.1
Browse files Browse the repository at this point in the history
Add support for Unicode 15.1
  • Loading branch information
3cp committed Jun 6, 2024
2 parents 7599cb2 + 4cbdd5c commit 17b1af9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"@types/node": "^18.6.3",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"@unicode/unicode-15.1.0": "^1.5.2",
"chalk": "^4.1.2",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
Expand All @@ -110,8 +111,7 @@
"tsconfig-paths": "^4.0.0",
"tslib": "^2.4.0",
"typescript": "^4.7.4",
"unexpected": "^13.0.0",
"unicode-13.0.0": "^0.8.0"
"unexpected": "^13.0.0"
},
"engines": {
"node": ">=10.4.0"
Expand Down
7 changes: 4 additions & 3 deletions scripts/generate-unicode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const VectorSize = Uint32Array.BYTES_PER_ELEMENT * 8;
const VectorMask = VectorSize - 1;
const VectorBitCount = 32 - Math.clz32(VectorMask);
const VectorByteSize = UnicodeCodeCount / VectorSize;
const UNICODE_VERSION = '15.1.0';

const DataInst = {
Empty: 0x0,
Expand Down Expand Up @@ -129,8 +130,8 @@ const makeDecompress = (compressed) => `((compressed, lookup) => {
exports.generate = generate;

async function generate(opts) {
await opts.write(`// Unicode v. 12 support
// tslint:disable
await opts.write(`// Unicode v${UNICODE_VERSION} support
/*eslint-disable*/
`);

const exportKeys = Object.keys(opts.exports);
Expand Down Expand Up @@ -167,7 +168,7 @@ ${opts.eval ? 'return' : 'export'} {${Object.keys(opts.exports)}};
if (require.main === module) {
const path = require('path');
const load = (name) => {
const mod = require.resolve(`unicode-13.0.0/${name}/code-points`);
const mod = require.resolve(`@unicode/unicode-${UNICODE_VERSION}/${name}/code-points`);
const list = require(mod);
delete require.cache[mod];
return list;
Expand Down

0 comments on commit 17b1af9

Please sign in to comment.