Last active
June 3, 2023 08:04
-
-
Save mathiasbynens/cfbf37892bd3142e70bb682a57964240 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const compare = (versionA, versionB) => { | |
// TODO: Does there exist a path for which every single Unicode version | |
// gets new entries? If so, use that instead. | |
const path = 'General_Category/Other_Letter'; | |
const before = new Set(require( | |
`unicode-${ versionA }/${ path }/code-points.js` | |
)); | |
const after = require( | |
`unicode-${ versionB }/${ path }/code-points.js` | |
); | |
console.log(`Comparing Unicode v${ versionA } to v${ versionB }…`); | |
const diff = after.filter(x => !before.has(x)); | |
if (diff.length) { | |
const hex = diff[0].toString(16).toUpperCase(); | |
console.log(`Smallest new code point value: ${ hex }`); | |
} else { | |
console.log('No new `Other_Letter` code points found.'); | |
} | |
}; | |
// npm i unicode-1.1.5 unicode-2.0.14 unicode-2.1.2 unicode-2.1.5 unicode-2.1.8 unicode-2.1.9 unicode-3.0.0 unicode-3.0.1 unicode-3.1.0 unicode-3.2.0 unicode-4.0.0 unicode-4.0.1 unicode-4.1.0 unicode-5.0.0 unicode-5.1.0 unicode-5.2.0 unicode-6.0.0 unicode-6.1.0 unicode-6.2.0 unicode-6.3.0 unicode-7.0.0 unicode-8.0.0 unicode-9.0.0 | |
compare('1.1.5', '2.0.14'); | |
compare('2.0.14', '2.1.2'); | |
compare('2.1.2', '2.1.5'); | |
compare('2.1.5', '2.1.8'); | |
compare('2.1.8', '2.1.9'); | |
compare('2.1.9', '3.0.0'); | |
compare('3.0.0', '3.0.1'); | |
compare('3.0.1', '3.1.0'); | |
compare('3.1.0', '3.2.0'); | |
compare('3.2.0', '4.0.0'); | |
compare('4.0.0', '4.0.1'); | |
compare('4.0.1', '4.1.0'); | |
compare('4.1.0', '5.0.0'); | |
compare('5.0.0', '5.1.0'); | |
compare('5.1.0', '5.2.0'); | |
compare('5.2.0', '6.0.0'); | |
compare('6.0.0', '6.1.0'); | |
compare('6.1.0', '6.2.0'); | |
compare('6.2.0', '6.3.0'); | |
compare('6.3.0', '7.0.0'); | |
compare('7.0.0', '8.0.0'); | |
compare('8.0.0', '9.0.0'); |
Author
mathiasbynens
commented
Jan 9, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment