node-unicode-data/0000755000175000017500000000000013633373356013772 5ustar jpuydtjpuydtnode-unicode-data/index.js0000644000175000017500000001341613633373232015435 0ustar jpuydtjpuydt'use strict'; const fs = require('fs'); const path = require('path'); const utils = require('./scripts/utils.js'); const parsers = require('./scripts/parse-blocks-scripts-properties.js'); parsers.parseBidiBrackets = require('./scripts/parse-bidi-brackets.js'); parsers.parseCaseFolding = require('./scripts/parse-case-folding.js'); parsers.parseCategories = require('./scripts/parse-categories.js'); parsers.parseCompositionExclusions = require('./scripts/parse-composition-exclusions.js'); parsers.parseLineBreak = require('./scripts/parse-line-break.js'); parsers.parseScriptExtensions = require('./scripts/parse-script-extensions.js'); parsers.parseWordBreak = require('./scripts/parse-word-break.js'); parsers.parseEmoji = require('./scripts/parse-emoji.js'); parsers.parseEmojiSequences = require('./scripts/parse-emoji-sequences.js'); parsers.parseNames = require('./scripts/parse-names.js'); const extend = utils.extend; const cp = require('cp'); const jsesc = require('jsesc'); const template = require('lodash.template'); const templatePath = path.resolve(__dirname, 'templates'); const staticPath = path.resolve(__dirname, 'static'); const compileReadMe = template(fs.readFileSync( path.resolve(templatePath, 'README.md'), 'utf-8') ); const compilePackage = template(fs.readFileSync( path.resolve(templatePath, 'package.json'), 'utf-8') ); const compileIndex = template('module.exports=<%= data %>'); const generateData = function(version) { const dirMap = {}; console.log('Generating data for Unicode v%s…', version); console.log('Parsing Unicode v%s categories…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseCategories(version), 'type': function(category) { if (/^(?:Any|ASCII|Assigned|Bidi_Mirrored)$/.test(category)) { return 'Binary_Property'; } if (/^Bidi_/.test(category)) { return 'Bidi_Class'; } return 'General_Category'; } })); console.log('Parsing Unicode v%s `Script`…', version); const scriptsMap = parsers.parseScripts(version) extend(dirMap, utils.writeFiles({ 'version': version, 'map': scriptsMap, 'type': 'Script' })); console.log('Parsing Unicode v%s `Script_Extensions`…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseScriptExtensions(version, scriptsMap), 'type': 'Script_Extensions' })); console.log('Parsing Unicode v%s properties…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseProperties(version), 'type': 'Binary_Property' })); console.log('Parsing Unicode v%s derived core properties…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseDerivedCoreProperties(version), 'type': 'Binary_Property' })); console.log('Parsing Unicode v%s derived normalization properties…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseDerivedNormalizationProperties(version), 'type': 'Binary_Property' })); console.log('Parsing Unicode v%s composition exclusions…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseCompositionExclusions(version), 'type': 'Binary_Property' })); console.log('Parsing Unicode v%s `Case_Folding`…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseCaseFolding(version), 'type': 'Case_Folding' })); console.log('Parsing Unicode v%s `Block`…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseBlocks(version), 'type': 'Block' })); console.log('Parsing Unicode v%s `Bidi_Mirroring_Glyph`', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseMirroring(version), 'type': 'Bidi_Mirroring_Glyph' })); console.log('Parsing Unicode v%s bidi brackets…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseBidiBrackets(version), 'type': 'Bidi_Paired_Bracket_Type' })); console.log('Parsing Unicode v%s `Line_Break`…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseLineBreak(version), 'type': 'Line_Break' })); console.log('Parsing Unicode v%s `Word_Break`…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseWordBreak(version), 'type': 'Word_Break' })); console.log('Parsing Unicode v%s binary emoji properties…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseEmoji(version), 'type': 'Binary_Property' })); console.log('Parsing Unicode v%s emoji sequence properties…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseEmojiSequences(version), 'type': 'Sequence_Property' })); console.log('Parsing Unicode v%s `Names`…', version); extend(dirMap, utils.writeFiles({ 'version': version, 'map': parsers.parseNames(version), 'type': 'Names' })); // Sort array values. for (const property of Object.keys(dirMap)) { if (Array.isArray(dirMap[property])) { dirMap[property] = dirMap[property].sort(); } } fs.writeFileSync( path.resolve(__dirname, 'output', 'unicode-' + version, 'README.md'), compileReadMe({ 'version': version, 'dirs': dirMap, 'regenerateExample': '<%= set.toString() %>' }) ); fs.writeFileSync( path.resolve(__dirname, 'output', 'unicode-' + version, 'index.js'), compileIndex({ 'version': version, 'data': jsesc(dirMap) }) ); fs.writeFileSync( path.resolve(__dirname, 'output', 'unicode-' + version, 'package.json'), compilePackage({ 'version': version }) ); [ '.gitattributes', '.gitignore' ].forEach(function(file) { cp.sync( path.resolve(staticPath, file), path.resolve(__dirname, 'output', 'unicode-' + version, file) ); }); return dirMap; }; module.exports = generateData; node-unicode-data/LICENSE-MIT.txt0000644000175000017500000000206513633373232016240 0ustar jpuydtjpuydtCopyright Mathias Bynens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-unicode-data/.travis.yml0000644000175000017500000000003613633373232016073 0ustar jpuydtjpuydtlanguage: node_js sudo: false node-unicode-data/templates/0000755000175000017500000000000013633373232015761 5ustar jpuydtjpuydtnode-unicode-data/templates/README.md0000644000175000017500000001162713633373232017247 0ustar jpuydtjpuydt# Unicode v<%= version %> data JavaScript-compatible Unicode data for use in Node.js. Included: arrays of code points, arrays of symbols, and regular expressions for Unicode v<%= version %>’s categories, scripts, script extensions, blocks, and properties, as well as bidi mirroring and case folding data. The data files in this module are generated as part of the [node-unicode-data](https://mths.be/node-unicode-data) project. **Please report any bugs or requests [in the appropriate issue tracker](https://github.com/mathiasbynens/node-unicode-data/issues).** ## Installation ```bash npm install unicode-<%= version %> --save-dev ``` **Note:** _unicode-<%= version %>_ is supposed to be used in build scripts (i.e. as a `devDependency`), and not at runtime (i.e. as a regular `dependency`). ## Regular expressions The Unicode data modules ship with pre-compiled regular expressions for categories, scripts, script extensions, blocks, and properties. But maybe you want to create a single regular expression that combines several categories, scripts, etc. In that case, [***you should use Regenerate***](https://mths.be/regenerate). For example, to construct a regex that matches all symbols in the Arabic and Greek scripts as per Unicode v6.3.0: ```js const regenerate = require('regenerate'); const set = regenerate() .add(require('unicode-6.3.0/Script_Extensions/Arabic/code-points.js')) // or `…/symbols`, doesn’t matter .add(require('unicode-6.3.0/Script_Extensions/Greek/code-points.js')); // or `…/symbols`, doesn’t matter console.log(set.toString()); // Then you might want to use a template like this to write the result to a file, along with any regex flags you might need: // const regex = /<%= regenerateExample %>/gim; ``` ## Usage ```js // Get an array of code points in a given Unicode category: const codePoints = require('unicode-<%= version %>/General_Category/Uppercase_Letter/code-points.js'); // Get an array of symbols (strings) in a given Unicode category: const symbols = require('unicode-<%= version %>/General_Category/Uppercase_Letter/symbols.js'); // Get a regular expression that matches any symbol in a given Unicode category: const regex = require('unicode-<%= version %>/General_Category/Uppercase_Letter/regex.js'); // Get the canonical category a given code point belongs to: // (Note: U+0041 is LATIN CAPITAL LETTER A) const category = require('unicode-<%= version %>/General_Category').get(0x41); // Get an array of all code points with a given bidi class: const on = require('unicode-<%= version %>/Bidi_Class/Other_Neutral/code-points.js'); // Get a map from code points to bidi classes: const bidiClassMap = require('unicode-<%= version %>/Bidi_Class'); // Get the directionality of a given code point: const directionality = require('unicode-<%= version %>/Bidi_Class').get(0x41); <% if (dirs.hasOwnProperty('Bidi_Mirroring_Glyph')) { %> // What glyph is the mirror image of `«` (U+00AB)? const mirrored = require('unicode-<%= version %>/Bidi_Mirroring_Glyph').get(0xAB); <% } if (dirs.hasOwnProperty('Bidi_Paired_Bracket_Type')) { %> // Get a regular expression that matches all opening brackets: const openingBrackets = require('unicode-<%= version %>/Bidi_Paired_Bracket_Type/Open/regex.js'); <% } %> // …you get the idea. ``` Other than categories, data on Unicode properties, blocks, scripts, and script extensions is available too (for recent versions of the Unicode standard). Here’s the full list of the available data for v<%= version %>: ```js<% Object.keys(dirs).forEach(function(type) { if (type == 'Names') { return; } %> // `<%= type %>`: <% if (/^(?:Bidi_Class|Bidi_Paired_Bracket_Type|Bidi_Mirroring_Glyph|General_Category)$/.test(type)) { %> require('unicode-<%= version %>/<%= type %>').get(codePoint); // lookup map <% } dirs[type].forEach(function(dir) { if ('Case_Folding' == type) { %> require('unicode-<%= version %>/<%= type %>/<%= dir %>/code-points.js'); // lookup map from code point to code point or array of code points require('unicode-<%= version %>/<%= type %>/<%= dir %>/code-points.js').get(codePoint); require('unicode-<%= version %>/<%= type %>/<%= dir %>/symbols.js'); // lookup map from symbol to symbol(s) require('unicode-<%= version %>/<%= type %>/<%= dir %>/symbols.js').get(symbol); <% } else if ('Sequence_Property' == type) { %> require('unicode-<%= version %>/<%= type %>/<%= dir %>/index.js'); // array containing a string for each sequence <% } else { %> require('unicode-<%= version %>/<%= type %>/<%= dir %>/code-points.js'); require('unicode-<%= version %>/<%= type %>/<%= dir %>/symbols.js'); require('unicode-<%= version %>/<%= type %>/<%= dir %>/regex.js'); <% } }); }); %>``` ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License This module is available under the [MIT](https://mths.be/mit) license. node-unicode-data/templates/package.json0000644000175000017500000000143613633373232020253 0ustar jpuydtjpuydt{ "name": "unicode-<%= version %>", "version": "0.8.0", "description": "JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v<%= version %>’s categories, scripts, blocks, bidi, and other properties.", "homepage": "https://github.com/mathiasbynens/unicode-<%= version %>", "main": "index.js", "keywords": [ "unicode", "unicode-data", "code points", "symbols", "characters", "bidi", "case-folding", "regex", "regexp", "data" ], "license": "MIT", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, "repository": { "type": "git", "url": "https://github.com/mathiasbynens/unicode-<%= version %>.git" }, "bugs": "https://github.com/mathiasbynens/node-unicode-data/issues" } node-unicode-data/.gitattributes0000644000175000017500000000011413633373232016652 0ustar jpuydtjpuydt# Automatically normalize line endings for all text-based files * text=auto node-unicode-data/scripts/0000755000175000017500000000000013633373232015452 5ustar jpuydtjpuydtnode-unicode-data/scripts/generate-data.js0000644000175000017500000000334713633373232020520 0ustar jpuydtjpuydt'use strict'; const resources = require('../data/resources.js'); const generateData = require('../index.js'); const utils = require('../scripts/utils.js'); // ----------------------------------------------------------------------------- const cluster = require('cluster'); const numCPUs = require('os').cpus().length; const pad = (number) => { return String(number).padStart(2, '0'); }; const getTime = () => { const currentdate = new Date(); return pad(currentdate.getHours()) + ':' + pad(currentdate.getMinutes()) + ':' + pad(currentdate.getSeconds()); }; const complicatedWorkThatTakesTime = (resource, callback) => { if (resource.length) { const version = resource[0].version; console.log('[%s] Worker %d \u2192 Unicode v%s', getTime(), cluster.worker.id, version); generateData(version); complicatedWorkThatTakesTime( resource.slice(1), callback ); } else { callback(); } }; if (cluster.isMaster) { for (let index = 0; index < numCPUs; index++) { cluster.fork(); } cluster.on('online', (worker) => { const size = Math.round(resources.length / numCPUs); const x = worker.id - 1; // divide work if (worker.id === 1) { // first worker worker.send(resources.slice(0, worker.id * size)); } else if (worker.id < numCPUs) { // other workers, except the last one worker.send(resources.slice(x * size, worker.id * size)); } else { // last worker worker.send(resources.slice(x * size, resources.length)); } }); cluster.on('exit', (worker) => { if (worker.exitedAfterDisconnect) { console.log('[%s] Worker %d is done!', getTime(), worker.id); } }); } else { process.on('message', (message) => { complicatedWorkThatTakesTime(message, () => { cluster.worker.kill(); }); }); } node-unicode-data/scripts/parse-word-break.js0000644000175000017500000000226213633373232021157 0ustar jpuydtjpuydt'use strict'; const utils = require('./utils.js'); const handled = new Set(); const parseWordBreak = function(version) { const source = utils.readDataFile(version, 'word-break'); if (!source) { return; } const map = {}; const lines = source.split('\n'); lines.forEach(function(line) { if (!line || /^#/.test(line)) { return; } const data = line.trim().split(';'); const charRange = data[0].replace('..', '-').trim(); const rangeParts = charRange.split('-'); const value = data[1].split('#')[0].trim(); const canonicalName = value; if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach((codePoint) => { utils.append(map, canonicalName, codePoint); handled.add(codePoint); }); } else { const codePoint = parseInt(charRange, 16); utils.append(map, canonicalName, codePoint); handled.add(codePoint); } }); // All code points not explicitly listed have the value `Other` (`XX`). for (let codePoint = 0x000000; codePoint <= 0x10FFFF; codePoint++) { if (!handled.has(codePoint)) { utils.append(map, 'Other', codePoint); } } return map; }; module.exports = parseWordBreak; node-unicode-data/scripts/utils.js0000644000175000017500000001222713633373232017154 0ustar jpuydtjpuydt'use strict'; const fs = require('fs'); const path = require('path'); const zlib = require('zlib'); const jsesc = require('jsesc'); const mkdirp = require('mkdirp'); const regenerate = require('regenerate'); const gzipInline = function(data) { if (data instanceof Map) { return `new Map(${ gzipInline([...data]) })`; } const json = jsesc(data, { 'json': true }); const gzipBuffer = zlib.gzipSync(json); return `JSON.parse(require('zlib').gunzipSync(${ jsesc(gzipBuffer) }))`; }; const range = function(start, stop) { // inclusive, e.g. `range(1, 3)` → `[1, 2, 3]` const result = []; for (; start <= stop; result.push(start++)); return result; }; const object = {}; const hasOwnProperty = object.hasOwnProperty; const hasKey = function(object, key) { return hasOwnProperty.call(object, key); }; const append = function(object, key, value) { if (hasKey(object, key)) { object[key].push(value); } else { object[key] = [value]; } }; const writeFiles = function(options) { const version = options.version; const map = options.map; if (map == null) { return; } const dirMap = {}; const auxMap = {}; Object.keys(map).forEach(function(item) { const codePoints = map[item]; const type = typeof options.type == 'function' ? options.type(item) : options.type; const isCaseFolding = type == 'Case_Folding'; const isBidiClass = type == 'Bidi_Class'; if (isBidiClass) { item = item.replace(/^Bidi_/, ''); } const dir = path.resolve( __dirname, '..', 'output', 'unicode-' + version, type, item ); if ( type == 'Bidi_Class' || type == 'Bidi_Mirroring_Glyph' || type == 'Bidi_Paired_Bracket_Type' || type == 'Names' || ( type == 'General_Category' && // Use the most specific category names, i.e. those whose aliases match // `^[A-Z][a-z]$`. Ignore the others. !/^(?:Other|Letter|Cased_Letter|Mark|Number|Punctuation|Symbol|Separator)$/.test(item) ) ) { if (!auxMap[type]) { auxMap[type] = []; } codePoints.forEach(function(codePoint) { console.assert(!auxMap[type][codePoint]); auxMap[type][codePoint] = item; }); } if (type == 'Bidi_Mirroring_Glyph' || type == 'Names') { return; } append(dirMap, type, item); // Create the target directory if it doesn’t exist yet. mkdirp.sync(dir); // Sequence properties are special. if (type == 'Sequence_Property') { const sequences = codePoints; const output = `module.exports=${ gzipInline(map[item]) }`; fs.writeFileSync( path.resolve(dir, 'index.js'), output ); return; } // Save the data to a file fs.writeFileSync( path.resolve(dir, 'code-points.js'), 'module.exports=' + ( codePoints.length > 999 ? gzipInline : jsesc )(codePoints) ); if (!isCaseFolding) { fs.writeFileSync( path.resolve(dir, 'regex.js'), 'module.exports=/' + regenerate(codePoints).toString() + '/' ); } const symbols = isCaseFolding ? (() => { const result = new Map(); for (let [from, to] of codePoints) { from = String.fromCodePoint(from); if (Array.isArray(to)) { to = String.fromCodePoint.apply(null, to); } else { to = String.fromCodePoint(to); } result.set(from, to); } return result; })() : codePoints.map((codePoint) => String.fromCodePoint(codePoint)); fs.writeFileSync( path.resolve(dir, 'symbols.js'), 'module.exports=' + ( !isCaseFolding && symbols.length > 999 ? gzipInline : jsesc )(symbols) ); }); Object.keys(auxMap).forEach(function(type) { const dir = path.resolve( __dirname, '..', 'output', 'unicode-' + version, type ); if (!hasKey(dirMap, type)) { dirMap[type] = []; } mkdirp.sync(dir); let output = ''; if (/^(?:Bidi_Class|Bidi_Mirroring_Glyph|bidi-brackets|Names)$/.test(type)) { const map = new Map(); Object.keys(auxMap[type]).forEach(function(key) { const codePoint = Number(key); const value = auxMap[type][key]; map.set(codePoint, value); }); if ('Bidi_Mirroring_Glyph' == type) { // `Bidi_Mirroring_Glyph/index.js` // Note: `Bidi_Mirroring_Glyph` doesn’t have repeated strings; don’t gzip. output = `module.exports=${ jsesc(map) }`; } else { // `Bidi_Class/index.js` or `bidi-brackets/index.js` or `Names/index.js` output = `module.exports=${ gzipInline(map) }`; } } else { // `categories/index.js` const array = auxMap[type]; output = `var x=${ gzipInline(array) };module.exports=new Map(x.entries())`; } fs.writeFileSync( path.resolve(dir, 'index.js'), output ); }); return dirMap; }; const extend = function(destination, source) { for (var key in source) { if (hasKey(source, key)) { if (!hasKey(destination, key)) { destination[key] = []; } source[key].forEach(function(item) { append(destination, key, item); }); } } }; const readDataFile = function(version, type) { const sourceFile = path.resolve( __dirname, '..', 'data', version + '-' + type + '.txt' ); if (!fs.existsSync(sourceFile)) { return; } const source = fs.readFileSync(sourceFile, 'utf-8'); return source; }; module.exports = { 'range': range, 'append': append, 'extend': extend, 'readDataFile': readDataFile, 'writeFiles': writeFiles }; node-unicode-data/scripts/parse-case-folding.js0000644000175000017500000000151013633373232021450 0ustar jpuydtjpuydt'use strict'; const utils = require('./utils.js'); const parseCaseFolding = function(version) { const caseFoldingMap = {}; const source = utils.readDataFile(version, 'case-folding'); if (!source) { return; } const lines = source.split('\n'); lines.forEach(function(line) { if (!line || /^#/.test(line)) { return; } const data = line.trim().split(';'); const codePoint = parseInt(data[0], 16); const status = data[1].trim(); const mappings = data[2].trim().split(' ').map(function(codePoint) { return parseInt(codePoint, 16); }); // Note: this could be two characters! if (!caseFoldingMap[status]) { caseFoldingMap[status] = new Map(); } caseFoldingMap[status].set( codePoint, mappings.length == 1 ? mappings[0] : mappings ); }); return caseFoldingMap; }; module.exports = parseCaseFolding; node-unicode-data/scripts/parse-emoji.js0000644000175000017500000000233213633373232020223 0ustar jpuydtjpuydt'use strict'; const utils = require('./utils.js'); const parseEmoji = function(version) { const source = utils.readDataFile(version, 'emoji'); if (!source) { return; } const propertyMap = new Map(); const lines = source.split('\n'); lines.forEach(function(line) { if (!line || /^#/.test(line)) { return; } const data = line.trim().split(' ; '); const charRange = data[0].replace('..', '-').trim(); const rangeParts = charRange.split('-'); const property = data[1].split('#')[0].trim(); if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach(function(codePoint) { if (propertyMap.has(property)) { propertyMap.get(property).add(codePoint); } else { propertyMap.set(property, new Set([codePoint])); } }); } else { const codePoint = parseInt(rangeParts, 16); if (propertyMap.has(property)) { propertyMap.get(property).add(codePoint); } else { propertyMap.set(property, new Set([codePoint])); } } }); const plainObject = {}; for (const [property, codePoints] of propertyMap) { plainObject[property] = [...codePoints].sort((a, b) => a - b); } return plainObject; }; module.exports = parseEmoji; node-unicode-data/scripts/parse-line-break.js0000644000175000017500000000261713633373232021137 0ustar jpuydtjpuydt'use strict'; const aliases = require('unicode-property-value-aliases').get('Line_Break'); const utils = require('./utils.js'); const findCanonicalName = function(shortName) { return aliases.get(shortName); }; const handled = new Set(); const parseLineBreak = function(version) { const source = utils.readDataFile(version, 'line-break'); if (!source) { return; } const map = {}; const lines = source.split('\n'); lines.forEach(function(line) { if (!line || /^#/.test(line)) { return; } const data = line.trim().split(';'); const charRange = data[0].replace('..', '-').trim(); const rangeParts = charRange.split('-'); const value = data[1].split('#')[0].trim(); const canonicalName = findCanonicalName(value); if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach(function(codePoint) { utils.append(map, canonicalName, codePoint); handled.add(codePoint); }); } else { const codePoint = parseInt(charRange, 16); utils.append(map, canonicalName, codePoint); handled.add(codePoint); } }); // All code points, assigned and unassigned, that are not listed explicitly // are given the value `XX`. for (let codePoint = 0x000000; codePoint <= 0x10FFFF; codePoint++) { if (!handled.has(codePoint)) { utils.append(map, 'Unknown', codePoint); } } return map; }; module.exports = parseLineBreak; node-unicode-data/scripts/parse-composition-exclusions.js0000644000175000017500000000161013633373232023653 0ustar jpuydtjpuydt'use strict'; const utils = require('./utils.js'); const parseCompositionExclusions = function(version) { const map = {}; const source = utils.readDataFile(version, 'composition-exclusions'); if (!source) { return; } const lines = source.split('\n'); lines.forEach(function(line) { if (!line || /^#/.test(line)) { return; } const data = line.trim().split('#'); const propertyName = 'Composition_Exclusion'; const charRange = data[0].replace('..', '-').trim(); const rangeParts = charRange.split('-'); if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach(function(codePoint) { utils.append(map, propertyName, codePoint); }); } else { const codePoint = parseInt(charRange, 16); utils.append(map, propertyName, codePoint); } }); return map; }; module.exports = parseCompositionExclusions; node-unicode-data/scripts/parse-categories.js0000644000175000017500000000446413633373232021255 0ustar jpuydtjpuydt'use strict'; const utils = require('./utils.js'); const valueAliases = require('unicode-property-value-aliases'); const bidiAliases = valueAliases.get('Bidi_Class'); const categoryAliases = valueAliases.get('General_Category'); const parseDatabase = function(version) { const symbolMap = new Map(); const bidiMap = new Map(); const bidiMirrored = new Set(); const source = utils.readDataFile(version, 'database'); if (!source) { return; } const lines = source.split('\n'); let flag = false; let first = 0; lines.forEach(function(line) { const data = line.trim().split(';'); const codePoint = parseInt(data[0], 16); const name = data[1]; const generalCategory = data[2]; const isBidiMirrored = data[9] == 'Y'; if (isBidiMirrored) { bidiMirrored.add(codePoint); } const bidiCategory = bidiAliases.get(data[4]); if (flag) { if (/<.+, Last>/.test(name)) { flag = false; utils.range(first, codePoint).forEach(function(value) { symbolMap.set(value, generalCategory); bidiMap.set(value, bidiCategory); }); } else { throw Error('Database exception'); } } else { if (/<.+, First>/.test(name)) { flag = true; first = codePoint; } else { symbolMap.set(codePoint, generalCategory); bidiMap.set(codePoint, bidiCategory); } } }); // http://unicode.org/reports/tr44/#GC_Values_Table // http://unicode.org/reports/tr18/#Categories const categoryMap = {}; let categories = []; for (let codePoint = 0x000000; codePoint <= 0x10FFFF; codePoint++) { // Note: `Any`, `ASCII`, and `Assigned` are actually properties, // not categories. http://unicode.org/reports/tr18/#Categories if (!symbolMap.has(codePoint)) { categories = ['Any', 'C', 'Cn']; } else { const tmp = symbolMap.get(codePoint); categories = ['Any', tmp, tmp.charAt(0), 'Assigned']; if (/^(?:Ll|Lu|Lt)$/.test(tmp)) { categories.push('LC'); } if (codePoint <= 0x7F) { categories.push('ASCII'); } } if (bidiMap.has(codePoint)) { categories.push('Bidi_' + bidiMap.get(codePoint)); } if (bidiMirrored.has(codePoint)) { categories.push('Bidi_Mirrored'); } for (const category of categories) { utils.append( categoryMap, categoryAliases.get(category) || category, codePoint ); } } return categoryMap; }; module.exports = parseDatabase; node-unicode-data/scripts/parse-blocks-scripts-properties.js0000644000175000017500000000502513633373232024256 0ustar jpuydtjpuydt'use strict'; const looseMatch = require('unicode-loose-match'); const propertyAliases = require('unicode-property-aliases'); const utils = require('./utils.js'); const parseBlocksScriptsProperties = function(type, version) { // `type` is 'properties', 'derived-core-properties', 'scripts', 'blocks', // or 'bidi-mirroring'. const map = {}; const source = utils.readDataFile(version, type); if (!source) { return; } const lines = source.split('\n'); for (const line of lines) { if ( /^#/.test(line) || !( /^(?:blocks|bidi-mirroring|properties)$/.test(type) ? /;\x20/.test(line) : /\x20;\x20/.test(line) ) ) { continue; } const data = line.trim().split(';'); const charRange = data[0].replace('..', '-').trim(); let item = data[1].split( type == 'blocks' ? ';' : '#' )[0].trim().replace(/\x20/g, '_'); if (type == 'derived-normalization-properties') { if (item == 'FNC') { // Old Unicode versions up to v4.0.0 use the `FNC` alias instead of // `FC_NFKC` (for `FC_NFKC_Closure`). This is not a binary property. continue; } else { const canonical = propertyAliases.get(item); if (canonical) { if (/FC_NFKC_Closure|NFKC_Casefold|(?:NFC|NFD|NFKC|NFKD)_Quick_Check/.test(canonical)) { // These are not binary properties, or their default value (in the // file) is not `True`. continue; } item = canonical; } } } if (type == 'blocks') { // Use canonical block names. See #34 const tmp = looseMatch('Block', item).value; console.assert(item, `Canonical block name not found for ${item}`); item = tmp; } else if (type == 'bidi-mirroring') { item = String.fromCodePoint(parseInt(item, 16)); } const rangeParts = charRange.split('-'); if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach(function(codePoint) { utils.append(map, item, codePoint); }); } else { utils.append(map, item, parseInt(charRange, 16)); } } return map; }; module.exports = { 'parseScripts': parseBlocksScriptsProperties.bind(null, 'scripts'), 'parseProperties': parseBlocksScriptsProperties.bind(null, 'properties'), 'parseDerivedCoreProperties': parseBlocksScriptsProperties.bind(null, 'derived-core-properties'), 'parseDerivedNormalizationProperties': parseBlocksScriptsProperties.bind(null, 'derived-normalization-properties'), 'parseBlocks': parseBlocksScriptsProperties.bind(null, 'blocks'), 'parseMirroring': parseBlocksScriptsProperties.bind(null, 'bidi-mirroring') }; node-unicode-data/scripts/download.js0000644000175000017500000000256513633373232017627 0ustar jpuydtjpuydt'use strict'; const fs = require('fs'); const guard = require('when/guard'); const path = require('path'); const request = require('request'); const resources = require('../data/resources.js'); const when = require('when'); const PARALLEL_REQUEST_LIMIT = 5; const download = function(url, version, type) { const deferred = when.defer(); const file = path.resolve( __dirname, '..', 'data', version + '-' + type + '.txt' ); console.log(' ', url, '→', path.basename(file)); request(url).on('end', function() { return deferred.resolve(); }).on('error', function(err) { return deferred.reject(err); }).pipe(fs.createWriteStream(file)); return deferred.promise; }; // Limit maximum parallelism to something reasonable const guardedDownload = guard(guard.n(PARALLEL_REQUEST_LIMIT), download); console.log('Downloading resources…'); const TYPES = [ 'scripts', 'script-extensions', 'blocks', 'properties', 'derived-core-properties', 'derived-normalization-properties', 'composition-exclusions', 'case-folding', 'bidi-mirroring', 'bidi-brackets', 'line-break', 'word-break', 'emoji', 'emoji-sequences', 'emoji-zwj-sequences' ]; for (const resource of resources) { const version = resource.version; guardedDownload(resource.main, version, 'database'); for (const type of TYPES) { if (resource[type]) { guardedDownload(resource[type], version, type); } } } node-unicode-data/scripts/parse-emoji-sequences.js0000644000175000017500000000311113633373232022210 0ustar jpuydtjpuydt'use strict'; const utils = require('./utils.js'); const parseEmojiSequencesWithId = ({ version, id }) => { const source = utils.readDataFile(version, id); if (!source) { return; } const propertyMap = new Map(); const lines = source.split('\n'); lines.forEach((line) => { if (!line || /^#/.test(line)) { return; } const data = line.trim().split('; '); const charRange = data[0].replace('..', '-').trim(); const rangeParts = charRange.split('-'); const property = data[1].split('#')[0].trim(); if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach((codePoint) => { const symbol = String.fromCodePoint(codePoint); if (propertyMap.has(property)) { propertyMap.get(property).add(symbol); } else { propertyMap.set(property, new Set([symbol])); } }); } else { const codePoints = data[0].trim().split(' ').map((hex) => { return parseInt(hex, 16); }); const sequence = String.fromCodePoint(...codePoints); if (propertyMap.has(property)) { propertyMap.get(property).add(sequence); } else { propertyMap.set(property, new Set([sequence])); } } }); const plainObject = {}; for (const [property, codePoints] of propertyMap) { plainObject[property] = [...codePoints].sort((a, b) => a - b); } return plainObject; }; const parseEmojiSequences = (version) => { return { ...parseEmojiSequencesWithId({ version, id: 'emoji-sequences' }), ...parseEmojiSequencesWithId({ version, id: 'emoji-zwj-sequences' }), }; }; module.exports = parseEmojiSequences; node-unicode-data/scripts/parse-script-extensions.js0000644000175000017500000000433513633373232022626 0ustar jpuydtjpuydt'use strict'; const scriptAliases = require('unicode-property-value-aliases').get('Script'); const utils = require('./utils.js'); const findCanonicalName = function(shortName) { return scriptAliases.get(shortName); }; const parseScriptExtensions = function(version, scriptsMap) { // Old Unicode versions lack scripts data. Return early in such cases. if (!scriptsMap) { return; } // Turn the array of code points for each script into a set, so we can more // easily add/remove from them. const knownScriptNames = Object.keys(scriptsMap); for (const script of knownScriptNames) { scriptsMap[script] = new Set(scriptsMap[script]); } const source = utils.readDataFile(version, 'script-extensions'); if (!source) { return; } const lines = source.split('\n'); lines.forEach(function(line) { if (!line || /^#/.test(line)) { return; } const data = line.trim().split(';'); const charRange = data[0].replace('..', '-').trim(); const rangeParts = charRange.split('-'); const scripts = data[1].split('#')[0].trim().split(' '); if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach(function(codePoint) { scripts.forEach(function(script) { const canonicalName = findCanonicalName(script); scriptsMap.Common.delete(codePoint); scriptsMap.Inherited.delete(codePoint); console.assert( scriptsMap[canonicalName], `canonical name for ${ script } = ${ canonicalName } not present in \`scriptsMap\`` ); scriptsMap[canonicalName].add(codePoint); }); }); } else { scripts.forEach(function(script) { const canonicalName = findCanonicalName(script); const codePoint = parseInt(charRange, 16); scriptsMap.Common.delete(codePoint); scriptsMap.Inherited.delete(codePoint); console.assert( scriptsMap[canonicalName], `canonical name for ${ script } = ${ canonicalName } not present in \`scriptsMap\`` ); scriptsMap[canonicalName].add(codePoint); }); } }); // Convert the sets back into arrays. for (const script of knownScriptNames) { scriptsMap[script] = [...scriptsMap[script]].sort((a, b) => a - b); } return scriptsMap; }; module.exports = parseScriptExtensions; node-unicode-data/scripts/parse-bidi-brackets.js0000644000175000017500000000274313633373232021631 0ustar jpuydtjpuydt'use strict'; const looseMatch = require('unicode-loose-match'); const propertyAliases = require('unicode-property-aliases'); const utils = require('./utils.js'); const bidiBracketMap = new Map([ ['o', 'Open'], ['c', 'Close'], ['n', 'None'] ]); const parseBidiBrackets = function(version) { const map = {}; const source = utils.readDataFile(version, 'bidi-brackets'); if (!source) { return; } const lines = source.split('\n'); const symbolsHandled = new Set(); lines.forEach(function(line) { if ( /^#/.test(line) || !/;\x20/.test(line) ) { return; } const data = line.trim().split(';'); const charRange = data[0].replace('..', '-').trim(); let item = data[2].split('#')[0].trim(); item = bidiBracketMap.get(item); const rangeParts = charRange.split('-'); if (rangeParts.length == 2) { utils.range( parseInt(rangeParts[0], 16), parseInt(rangeParts[1], 16) ).forEach(function(codePoint) { symbolsHandled.add(codePoint); utils.append(map, item, codePoint); }); } else { const codePoint = parseInt(charRange, 16); symbolsHandled.add(codePoint); utils.append(map, item, codePoint); } }); for (let codePoint = 0x000000; codePoint <= 0x10FFFF; codePoint++) { // Note: `Any`, `ASCII`, and `Assigned` are actually properties, // not categories. http://unicode.org/reports/tr18/#Categories if (!symbolsHandled.has(codePoint)) { utils.append(map, 'None', codePoint); } } return map; }; module.exports = parseBidiBrackets; node-unicode-data/scripts/parse-names.js0000644000175000017500000000165313633373232020230 0ustar jpuydtjpuydt'use strict'; const utils = require('./utils.js'); const parseNames = function(version) { const map = {}; const source = utils.readDataFile(version, 'database'); if (!source) { return; } const lines = source.split('\n'); let flag = false; let first = 0; lines.forEach(function(line) { const data = line.trim().split(';'); const codePoint = parseInt(data[0], 16); const name = data[1]; if (!isNaN(codePoint)) { if (flag) { if (/<.+, Last>/.test(name)) { flag = false; const rangeName = /<(.+), Last>/.exec(name)[1]; utils.range(first, codePoint).forEach(function (value) { utils.append(map, rangeName, value); }); } else { throw Error('Database exception'); } } else { if (/<.+, First>/.test(name)) { flag = true; first = codePoint; } else { utils.append(map, name, codePoint); } } } }); return map; }; module.exports = parseNames; node-unicode-data/bootstrap.sh0000755000175000017500000000073413633373232016343 0ustar jpuydtjpuydt#!/usr/bin/env bash cd "$(dirname "${BASH_SOURCE}")"; #rm -rf -- output/*/*!(.git); npm run build; cd output; for dir in $(find ./unicode-* -type d -maxdepth 0 | sort -r); do cd "${dir}"; echo "Taking care of ${dir}…"; git add -A; git commit -m 'Update @ https://github.com/mathiasbynens/node-unicode-data/commit/2d076c0f5bf6871644f745834b67003cf9e7dd2d'; #git commit -m 'Release v0.7.5' #git tag v0.7.5; git push; #git push --tags; #npm publish; cd ..; done; node-unicode-data/README.md0000644000175000017500000002012713633373232015244 0ustar jpuydtjpuydt# node-unicode-data [![Build status](https://travis-ci.org/mathiasbynens/node-unicode-data.svg?branch=master)](https://travis-ci.org/mathiasbynens/node-unicode-data) JavaScript-compatible Unicode data generator. Arrays of code points, arrays of symbols, and regular expressions for every Unicode version’s categories, scripts, script extensions, blocks, bidi data, and other properties — neatly packaged into a separate npm package per Unicode version. ## Using the data in your scripts To use the generated data, simply install one of [the npm modules generated by this script](https://npmjs.org/browse/keyword/unicode-data). Separate packages are available for each Unicode version. This allows you to do stuff like: ```js // Get an array of all code points with the `White_Space` property: const codePoints = require('unicode-6.3.0/Binary_Property/White_Space/code-points'); // Get an array of strings (containing one symbol each) in the `Lu` category: const symbols = require('unicode-6.3.0/General_Category/Uppercase_Letter/symbols'); // Get a regular expression that matches any symbol in the `Aegean Numbers` block: const regex = require('unicode-6.3.0/Block/Aegean_Numbers/regex'); // Get an array of all code points in the `Egyptian_Hieroglyphs` script: const hieroglyphs = require('unicode-6.3.0/Script/Egyptian_Hieroglyphs/code-points'); // Get the canonical category a given code point belongs to: // (Note: U+0041 is LATIN CAPITAL LETTER A) const category = require('unicode-6.3.0/General_Category').get(0x41); // Get an array of all code points with a given bidi class: const lre = require('unicode-6.3.0/Bidi_Class/Left_To_Right_Embedding/code-points'); // Get the directionality of a given code point: const directionality = require('unicode-6.3.0/Bidi_Class').get(0x41); // What glyph is the mirror image of `«` (U+00AB)? const mirrored = require('unicode-6.3.0/Bidi_Mirroring_Glyph').get(0xAB); // Get a regular expression that matches all opening brackets: const openingBrackets = require('unicode-6.3.0/Bidi_Paired_Bracket_Type/Open/regex'); // …you get the idea. ``` For more information, see the README for the package you’re interested in. [Here’s the full list of npm packages generated by this script](https://npmjs.org/browse/keyword/unicode-data): * [_unicode-1.1.5_](https://npmjs.org/package/unicode-1.1.5#readme) ([repository](https://github.com/mathiasbynens/unicode-1.1.5#readme)) * [_unicode-2.0.14_](https://npmjs.org/package/unicode-2.0.14#readme) ([repository](https://github.com/mathiasbynens/unicode-2.0.14#readme)) * [_unicode-2.1.2_](https://npmjs.org/package/unicode-2.1.2#readme) ([repository](https://github.com/mathiasbynens/unicode-2.1.2#readme)) * [_unicode-2.1.5_](https://npmjs.org/package/unicode-2.1.5#readme) ([repository](https://github.com/mathiasbynens/unicode-2.1.5#readme)) * [_unicode-2.1.8_](https://npmjs.org/package/unicode-2.1.8#readme) ([repository](https://github.com/mathiasbynens/unicode-2.1.8#readme)) * [_unicode-2.1.9_](https://npmjs.org/package/unicode-2.1.9#readme) ([repository](https://github.com/mathiasbynens/unicode-2.1.9#readme)) * [_unicode-3.0.0_](https://npmjs.org/package/unicode-3.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-3.0.0#readme)) * [_unicode-3.0.1_](https://npmjs.org/package/unicode-3.0.1#readme) ([repository](https://github.com/mathiasbynens/unicode-3.0.1#readme)) * [_unicode-3.1.0_](https://npmjs.org/package/unicode-3.1.0#readme) ([repository](https://github.com/mathiasbynens/unicode-3.1.0#readme)) * [_unicode-3.2.0_](https://npmjs.org/package/unicode-3.2.0#readme) ([repository](https://github.com/mathiasbynens/unicode-3.2.0#readme)) * [_unicode-4.0.0_](https://npmjs.org/package/unicode-4.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-4.0.0#readme)) * [_unicode-4.0.1_](https://npmjs.org/package/unicode-4.0.1#readme) ([repository](https://github.com/mathiasbynens/unicode-4.0.1#readme)) * [_unicode-4.1.0_](https://npmjs.org/package/unicode-4.1.0#readme) ([repository](https://github.com/mathiasbynens/unicode-4.1.0#readme)) * [_unicode-5.0.0_](https://npmjs.org/package/unicode-5.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-5.0.0#readme)) * [_unicode-5.1.0_](https://npmjs.org/package/unicode-5.1.0#readme) ([repository](https://github.com/mathiasbynens/unicode-5.1.0#readme)) * [_unicode-5.2.0_](https://npmjs.org/package/unicode-5.2.0#readme) ([repository](https://github.com/mathiasbynens/unicode-5.2.0#readme)) * [_unicode-6.0.0_](https://npmjs.org/package/unicode-6.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-6.0.0#readme)) * [_unicode-6.1.0_](https://npmjs.org/package/unicode-6.1.0#readme) ([repository](https://github.com/mathiasbynens/unicode-6.1.0#readme)) * [_unicode-6.2.0_](https://npmjs.org/package/unicode-6.2.0#readme) ([repository](https://github.com/mathiasbynens/unicode-6.2.0#readme)) * [_unicode-6.3.0_](https://npmjs.org/package/unicode-6.3.0#readme) ([repository](https://github.com/mathiasbynens/unicode-6.3.0#readme)) * [_unicode-7.0.0_](https://npmjs.org/package/unicode-7.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-7.0.0#readme)) * [_unicode-8.0.0_](https://npmjs.org/package/unicode-8.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-8.0.0#readme)) * [_unicode-9.0.0_](https://npmjs.org/package/unicode-9.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-9.0.0#readme)) * [_unicode-10.0.0_](https://npmjs.org/package/unicode-10.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-10.0.0#readme)) * [_unicode-11.0.0_](https://npmjs.org/package/unicode-11.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-11.0.0#readme)) * [_unicode-12.0.0_](https://npmjs.org/package/unicode-12.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-12.0.0#readme)) * [_unicode-12.1.0_](https://npmjs.org/package/unicode-12.1.0#readme) ([repository](https://github.com/mathiasbynens/unicode-12.1.0#readme)) * [_unicode-13.0.0_](https://npmjs.org/package/unicode-13.0.0#readme) ([repository](https://github.com/mathiasbynens/unicode-13.0.0#readme)) Note that these READMEs are auto-generated by this script, too – they describe all the data that is available for that particular Unicode version. To programmatically get this list of available categories, scripts, script extensions, blocks, and properties for a given Unicode version, just `require` the main module for that version: ```js > require('unicode-6.3.0'); { 'Binary_Property': [ 'Alphabetic', 'Any', 'ASCII', 'ASCII_Hex_Digit', 'Assigned', … ], 'General_Category': [ 'Cased_Letter','Close_Punctuation','Connector_Punctuation', … ], 'Script': [ 'Arabic', 'Armenian', 'Avestan', … ], 'Script_Extensions': [ 'Arabic', 'Armenian', 'Avestan', … ], 'Block': [ 'Aegean Numbers', 'Alchemical Symbols', … ], 'Case_Folding': [ 'C', 'F', 'S', 'T' ], 'Bidi_Class': [ 'Arabic_Letter', 'Arabic_Number', 'Boundary_Neutral', … ], 'Bidi_Mirroring_Glyph': [], 'Bidi_Paired_Bracket_Type': [ 'Close', 'None', 'Open' ] } ``` ## Generating the data `npm run-script download` (re-)downloads the Unicode source files for all the Unicode versions defined in `data/resources.js`, saving them in the `data` folder. `npm run-script build` generates data for categories, scripts, blocks, and properties for all the Unicode versions defined in `data/resources.js`. This may take a few minutes… In total, roughly 1.5 GB of data is generated. The regular expressions are generated using [Regenerate](https://mths.be/regenerate). ## Testing `npm test` generates the data for the oldest and latest available Unicode version. This is a good way to test changes to the generator scripts before running `npm run-script generate`. `npm run-script cover` generates [the code coverage report](http://rawgithub.com/mathiasbynens/node-unicode-data/master/coverage/index.html). ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License This module is available under the [MIT](https://mths.be/mit) license. node-unicode-data/static/0000755000175000017500000000000013633373232015252 5ustar jpuydtjpuydtnode-unicode-data/static/.gitattributes0000644000175000017500000000011413633373232020141 0ustar jpuydtjpuydt# Automatically normalize line endings for all text-based files * text=auto node-unicode-data/static/.gitignore0000644000175000017500000000035313633373232017243 0ustar jpuydtjpuydt# npm error logs npm-debug.log # Installed npm modules node_modules # Folder view configuration files .DS_Store Desktop.ini # Thumbnail cache files ._* Thumbs.db # Files that might appear on external disks .Spotlight-V100 .Trashes node-unicode-data/.gitignore0000644000175000017500000000040013633373232015745 0ustar jpuydtjpuydt# Generated data output # Coverage report coverage # Installed npm modules node_modules # Folder view configuration files .DS_Store Desktop.ini # Thumbnail cache files ._* Thumbs.db # Files that might appear on external disks .Spotlight-V100 .Trashes node-unicode-data/.nvmrc0000644000175000017500000000000313633373232015102 0ustar jpuydtjpuydt10 node-unicode-data/package.json0000644000175000017500000000301013633373232016243 0ustar jpuydtjpuydt{ "name": "unicode-data", "version": "0.1.0", "description": "JavaScript-compatible Unicode data generator. Arrays of code points, arrays of symbols, and regular expressions for every Unicode version’s categories, scripts, blocks, and properties.", "homepage": "https://mths.be/node-unicode-data", "main": "index.js", "keywords": [ "unicode", "code points", "regex", "regexp", "data", "generator", "tool" ], "license": "MIT", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, "repository": { "type": "git", "url": "https://github.com/mathiasbynens/node-unicode-data.git" }, "bugs": "https://github.com/mathiasbynens/node-unicode-data/issues", "files": [ "LICENSE-MIT.txt", "index.js", "data/", "scripts/", "templates/", "tests/" ], "scripts": { "download": "node scripts/download.js", "clean": "rm -rf -- output/*/*!(.git)", "build": "node scripts/generate-data.js", "test": "node tests/tests.js", "t": "node tests/quick.js", "cover": "istanbul cover --report html --verbose --dir coverage tests/tests.js" }, "dependencies": { "cp": "^0.2.0", "jsesc": "^2.5.2", "lodash.template": "^4.4.0", "mkdirp": "^0.5.1", "regenerate": "^1.4.0", "request": "^2.88.0", "unicode-loose-match": "^2.5.0", "unicode-property-aliases": "^1.5.0", "unicode-property-value-aliases": "^3.5.0", "when": "^3.7.8" }, "devDependencies": { "istanbul": "^0.4.5" } }