Skip to content

Instantly share code, notes, and snippets.

@franjohn21
Created September 19, 2017 05:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franjohn21/6609b4366b44b6dc69a785d4212e9bb6 to your computer and use it in GitHub Desktop.
Save franjohn21/6609b4366b44b6dc69a785d4212e9bb6 to your computer and use it in GitHub Desktop.
Inverse of critical unicode-range
const CharacterSet = require('characterset')
const critical = CharacterSet.parseUnicodeRange('U+00-A0,U+A9,U+AE,U+B2-B3,U+B9,U+2013-2014');
const all = CharacterSet.parseUnicodeRange('U+0000-FFFF');
const inverseOfCritical = all.difference(critical)
console.log(inverseOfCritical.toHexRangeString())
// => U+A1-A8,U+AA-AD,U+AF-B1,U+B4-B8,U+BA-2012,U+2015-FFFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment