Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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');
@mathiasbynens

This comment has been minimized.

Copy link
Owner Author

commented Jan 9, 2017

$ node find-new-Lo-code-points.js
Comparing Unicode v1.1.5 to v2.0.14…
Smallest new code point value: 93D
Comparing Unicode v2.0.14 to v2.1.2…
No new `Other_Letter` code points found.
Comparing Unicode v2.1.2 to v2.1.5…
No new `Other_Letter` code points found.
Comparing Unicode v2.1.5 to v2.1.8…
Smallest new code point value: 950
Comparing Unicode v2.1.8 to v2.1.9…
No new `Other_Letter` code points found.
Comparing Unicode v2.1.9 to v3.0.0…
Smallest new code point value: 6B8
Comparing Unicode v3.0.0 to v3.0.1…
No new `Other_Letter` code points found.
Comparing Unicode v3.0.1 to v3.1.0…
Smallest new code point value: 10300
Comparing Unicode v3.1.0 to v3.2.0…
Smallest new code point value: 66E
Comparing Unicode v3.2.0 to v4.0.0…
Smallest new code point value: 6EE
Comparing Unicode v4.0.0 to v4.0.1…
No new `Other_Letter` code points found.
Comparing Unicode v4.0.1 to v4.1.0…
Smallest new code point value: 750
Comparing Unicode v4.1.0 to v5.0.0…
Smallest new code point value: 294
Comparing Unicode v5.0.0 to v5.1.0…
Smallest new code point value: 63B
Comparing Unicode v5.1.0 to v5.2.0…
Smallest new code point value: 800
Comparing Unicode v5.2.0 to v6.0.0…
Smallest new code point value: 620
Comparing Unicode v6.0.0 to v6.1.0…
Smallest new code point value: AA
Comparing Unicode v6.1.0 to v6.2.0…
No new `Other_Letter` code points found.
Comparing Unicode v6.2.0 to v6.3.0…
No new `Other_Letter` code points found.
Comparing Unicode v6.3.0 to v7.0.0…
Smallest new code point value: 8A1
Comparing Unicode v7.0.0 to v8.0.0…
Smallest new code point value: 8B3
Comparing Unicode v8.0.0 to v9.0.0…
Smallest new code point value: 8B6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.