Skip to content

Commit

Permalink
Update to Unicode v16.0.0 (#92)
Browse files Browse the repository at this point in the history
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
  • Loading branch information
mathiasbynens and JLHwung authored Sep 18, 2024
1 parent 2a9179f commit c74aa34
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 10 deletions.
54 changes: 54 additions & 0 deletions data/iu-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = new Map([
[0xDF, 0x1E9E],
[0xE5, 0x212B],
[0x17F, 0x53],
[0x19B, 0xA7DC],
[0x1C4, 0x1C5],
[0x1C5, 0x1C4],
[0x1C7, 0x1C8],
Expand All @@ -16,6 +17,7 @@ module.exports = new Map([
[0x1CB, 0x1CA],
[0x1F1, 0x1F2],
[0x1F2, 0x1F1],
[0x264, 0xA7CB],
[0x345, 0x1FBE],
[0x390, 0x1FD3],
[0x392, 0x3D0],
Expand Down Expand Up @@ -64,6 +66,8 @@ module.exports = new Map([
[0x1C86, 0x42A],
[0x1C87, 0x462],
[0x1C88, 0xA64A],
[0x1C89, 0x1C8A],
[0x1C8A, 0x1C89],
[0x1E60, 0x1E9B],
[0x1E9B, 0x1E60],
[0x1E9E, 0xDF],
Expand Down Expand Up @@ -137,6 +141,12 @@ module.exports = new Map([
0xE5
]],
[0xA64A, 0x1C88],
[0xA7CB, 0x264],
[0xA7CC, 0xA7CD],
[0xA7CD, 0xA7CC],
[0xA7DA, 0xA7DB],
[0xA7DB, 0xA7DA],
[0xA7DC, 0x19B],
[0xFB05, 0xFB06],
[0xFB06, 0xFB05],
[0x10400, 0x10428],
Expand Down Expand Up @@ -463,6 +473,50 @@ module.exports = new Map([
[0x10CF0, 0x10CB0],
[0x10CF1, 0x10CB1],
[0x10CF2, 0x10CB2],
[0x10D50, 0x10D70],
[0x10D51, 0x10D71],
[0x10D52, 0x10D72],
[0x10D53, 0x10D73],
[0x10D54, 0x10D74],
[0x10D55, 0x10D75],
[0x10D56, 0x10D76],
[0x10D57, 0x10D77],
[0x10D58, 0x10D78],
[0x10D59, 0x10D79],
[0x10D5A, 0x10D7A],
[0x10D5B, 0x10D7B],
[0x10D5C, 0x10D7C],
[0x10D5D, 0x10D7D],
[0x10D5E, 0x10D7E],
[0x10D5F, 0x10D7F],
[0x10D60, 0x10D80],
[0x10D61, 0x10D81],
[0x10D62, 0x10D82],
[0x10D63, 0x10D83],
[0x10D64, 0x10D84],
[0x10D65, 0x10D85],
[0x10D70, 0x10D50],
[0x10D71, 0x10D51],
[0x10D72, 0x10D52],
[0x10D73, 0x10D53],
[0x10D74, 0x10D54],
[0x10D75, 0x10D55],
[0x10D76, 0x10D56],
[0x10D77, 0x10D57],
[0x10D78, 0x10D58],
[0x10D79, 0x10D59],
[0x10D7A, 0x10D5A],
[0x10D7B, 0x10D5B],
[0x10D7C, 0x10D5C],
[0x10D7D, 0x10D5D],
[0x10D7E, 0x10D5E],
[0x10D7F, 0x10D5F],
[0x10D80, 0x10D60],
[0x10D81, 0x10D61],
[0x10D82, 0x10D62],
[0x10D83, 0x10D63],
[0x10D84, 0x10D64],
[0x10D85, 0x10D65],
[0x118A0, 0x118C0],
[0x118A1, 0x118C1],
[0x118A2, 0x118C2],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
},
"dependencies": {
"regenerate": "^1.4.2",
"regenerate-unicode-properties": "^10.1.1",
"regenerate-unicode-properties": "^10.2.0",
"regjsgen": "^0.8.0",
"regjsparser": "^0.10.0",
"unicode-match-property-ecmascript": "^2.0.0",
"unicode-match-property-value-ecmascript": "^2.1.0"
},
"devDependencies": {
"jsesc": "^3.0.2",
"@unicode/unicode-15.1.0": "^1.5.2"
"@unicode/unicode-16.0.0": "^1.6.0"
}
}
2 changes: 1 addition & 1 deletion scripts/character-class-escape-sets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');
const jsesc = require('jsesc');
const regenerate = require('regenerate');

const Zs = require('@unicode/unicode-15.1.0/General_Category/Space_Separator/code-points.js');
const Zs = require('@unicode/unicode-16.0.0/General_Category/Space_Separator/code-points.js');

const iuMappings = require('../data/iu-mappings.js');

Expand Down
4 changes: 2 additions & 2 deletions scripts/iu-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ const extend = (map, key, value, callback) => {
// A. To do a simple case folding, use the mappings with status C + S.
// B. To do a full case folding, use the mappings with status C + F.

const commonMappings = require('@unicode/unicode-15.1.0/Case_Folding/C/code-points.js');
const simpleMappings = require('@unicode/unicode-15.1.0/Case_Folding/S/code-points.js');
const commonMappings = require('@unicode/unicode-16.0.0/Case_Folding/C/code-points.js');
const simpleMappings = require('@unicode/unicode-16.0.0/Case_Folding/S/code-points.js');

// We want the `C` mappings in both directions (i.e. `A` should fold to `a`
// and `a` to `A`), and the `S` mappings in both directions (i.e. `ẞ` should
Expand Down
23 changes: 19 additions & 4 deletions tests/fixtures/unicode-set.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('rewritePattern { unicodeFlag }', () => {
});

const getPropertyValuePattern = (path) => {
const codePoints = require(`@unicode/unicode-15.1.0/${
const codePoints = require(`@unicode/unicode-16.0.0/${
path }/code-points.js`);
return {
'p': regenerate(codePoints).toString(),
Expand Down

0 comments on commit c74aa34

Please sign in to comment.