unicode-property-aliases-1.3.0/000077500000000000000000000000001324360577500164565ustar00rootroot00000000000000unicode-property-aliases-1.3.0/.editorconfig000066400000000000000000000003161324360577500211330ustar00rootroot00000000000000root = true [*] charset = utf-8 indent_style = tab end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true [{README.md,package.json,.travis.yml}] indent_style = space indent_size = 2 unicode-property-aliases-1.3.0/.gitattributes000066400000000000000000000000141324360577500213440ustar00rootroot00000000000000* text=auto unicode-property-aliases-1.3.0/.gitignore000066400000000000000000000003131324360577500204430ustar00rootroot00000000000000# 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 unicode-property-aliases-1.3.0/.travis.yml000066400000000000000000000000531324360577500205650ustar00rootroot00000000000000language: node_js node_js: - "6" - "4" unicode-property-aliases-1.3.0/LICENSE-MIT.txt000066400000000000000000000020651324360577500207330ustar00rootroot00000000000000Copyright 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. unicode-property-aliases-1.3.0/README.md000066400000000000000000000023211324360577500177330ustar00rootroot00000000000000# unicode-property-aliases [![Build status](https://travis-ci.org/mathiasbynens/unicode-property-aliases.svg?branch=master)](https://travis-ci.org/mathiasbynens/unicode-property-aliases) _unicode-property-aliases_ offers the Unicode property alias mappings in an easy-to-consume JavaScript format. It’s based on [draft 16 of the `PropertyAliases.txt` data for Unicode v11.0.0](https://unicode.org/Public/11.0.0/ucd/PropertyAliases-11.0.0d16.txt). ## Installation To use _unicode-property-aliases_ programmatically, install it as a dependency via [npm](https://www.npmjs.com/): ```bash $ npm install unicode-property-aliases ``` Then, `require` it: ```js const propertyAliases = require('unicode-property-aliases'); ``` ## Usage This module exports a `Map` object. The most common usage is to convert a property alias to its canonical form: ```js propertyAliases.get('sfc') // → 'Simple_Case_Folding' ``` ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License _unicode-property-aliases_ is available under the [MIT](https://mths.be/mit) license. unicode-property-aliases-1.3.0/index.js000077500000000000000000000077101324360577500201330ustar00rootroot00000000000000// Generated using `npm run build`. Do not edit! module.exports = new Map([ ['cjkAccountingNumeric', 'kAccountingNumeric'], ['cjkOtherNumeric', 'kOtherNumeric'], ['cjkPrimaryNumeric', 'kPrimaryNumeric'], ['nv', 'Numeric_Value'], ['cf', 'Case_Folding'], ['cjkCompatibilityVariant', 'kCompatibilityVariant'], ['dm', 'Decomposition_Mapping'], ['FC_NFKC', 'FC_NFKC_Closure'], ['lc', 'Lowercase_Mapping'], ['NFKC_CF', 'NFKC_Casefold'], ['scf', 'Simple_Case_Folding'], ['sfc', 'Simple_Case_Folding'], ['slc', 'Simple_Lowercase_Mapping'], ['stc', 'Simple_Titlecase_Mapping'], ['suc', 'Simple_Uppercase_Mapping'], ['tc', 'Titlecase_Mapping'], ['uc', 'Uppercase_Mapping'], ['bmg', 'Bidi_Mirroring_Glyph'], ['bpb', 'Bidi_Paired_Bracket'], ['cjkIICore', 'kIICore'], ['cjkIRG_GSource', 'kIRG_GSource'], ['cjkIRG_HSource', 'kIRG_HSource'], ['cjkIRG_JSource', 'kIRG_JSource'], ['cjkIRG_KPSource', 'kIRG_KPSource'], ['cjkIRG_KSource', 'kIRG_KSource'], ['cjkIRG_MSource', 'kIRG_MSource'], ['cjkIRG_TSource', 'kIRG_TSource'], ['cjkIRG_USource', 'kIRG_USource'], ['cjkIRG_VSource', 'kIRG_VSource'], ['cjkRSUnicode', 'kRSUnicode'], ['Unicode_Radical_Stroke', 'kRSUnicode'], ['URS', 'kRSUnicode'], ['EqUIdeo', 'Equivalent_Unified_Ideograph'], ['isc', 'ISO_Comment'], ['JSN', 'Jamo_Short_Name'], ['na', 'Name'], ['na1', 'Unicode_1_Name'], ['Name_Alias', 'Name_Alias'], ['scx', 'Script_Extensions'], ['age', 'Age'], ['blk', 'Block'], ['sc', 'Script'], ['bc', 'Bidi_Class'], ['bpt', 'Bidi_Paired_Bracket_Type'], ['ccc', 'Canonical_Combining_Class'], ['dt', 'Decomposition_Type'], ['ea', 'East_Asian_Width'], ['gc', 'General_Category'], ['GCB', 'Grapheme_Cluster_Break'], ['hst', 'Hangul_Syllable_Type'], ['InPC', 'Indic_Positional_Category'], ['InSC', 'Indic_Syllabic_Category'], ['jg', 'Joining_Group'], ['jt', 'Joining_Type'], ['lb', 'Line_Break'], ['NFC_QC', 'NFC_Quick_Check'], ['NFD_QC', 'NFD_Quick_Check'], ['NFKC_QC', 'NFKC_Quick_Check'], ['NFKD_QC', 'NFKD_Quick_Check'], ['nt', 'Numeric_Type'], ['SB', 'Sentence_Break'], ['vo', 'Vertical_Orientation'], ['WB', 'Word_Break'], ['AHex', 'ASCII_Hex_Digit'], ['Alpha', 'Alphabetic'], ['Bidi_C', 'Bidi_Control'], ['Bidi_M', 'Bidi_Mirrored'], ['Cased', 'Cased'], ['CE', 'Composition_Exclusion'], ['CI', 'Case_Ignorable'], ['Comp_Ex', 'Full_Composition_Exclusion'], ['CWCF', 'Changes_When_Casefolded'], ['CWCM', 'Changes_When_Casemapped'], ['CWKCF', 'Changes_When_NFKC_Casefolded'], ['CWL', 'Changes_When_Lowercased'], ['CWT', 'Changes_When_Titlecased'], ['CWU', 'Changes_When_Uppercased'], ['Dash', 'Dash'], ['Dep', 'Deprecated'], ['DI', 'Default_Ignorable_Code_Point'], ['Dia', 'Diacritic'], ['Ext', 'Extender'], ['Gr_Base', 'Grapheme_Base'], ['Gr_Ext', 'Grapheme_Extend'], ['Gr_Link', 'Grapheme_Link'], ['Hex', 'Hex_Digit'], ['Hyphen', 'Hyphen'], ['IDC', 'ID_Continue'], ['Ideo', 'Ideographic'], ['IDS', 'ID_Start'], ['IDSB', 'IDS_Binary_Operator'], ['IDST', 'IDS_Trinary_Operator'], ['Join_C', 'Join_Control'], ['LOE', 'Logical_Order_Exception'], ['Lower', 'Lowercase'], ['Math', 'Math'], ['NChar', 'Noncharacter_Code_Point'], ['OAlpha', 'Other_Alphabetic'], ['ODI', 'Other_Default_Ignorable_Code_Point'], ['OGr_Ext', 'Other_Grapheme_Extend'], ['OIDC', 'Other_ID_Continue'], ['OIDS', 'Other_ID_Start'], ['OLower', 'Other_Lowercase'], ['OMath', 'Other_Math'], ['OUpper', 'Other_Uppercase'], ['Pat_Syn', 'Pattern_Syntax'], ['Pat_WS', 'Pattern_White_Space'], ['PCM', 'Prepended_Concatenation_Mark'], ['QMark', 'Quotation_Mark'], ['Radical', 'Radical'], ['RI', 'Regional_Indicator'], ['SD', 'Soft_Dotted'], ['STerm', 'Sentence_Terminal'], ['Term', 'Terminal_Punctuation'], ['UIdeo', 'Unified_Ideograph'], ['Upper', 'Uppercase'], ['VS', 'Variation_Selector'], ['WSpace', 'White_Space'], ['space', 'White_Space'], ['XIDC', 'XID_Continue'], ['XIDS', 'XID_Start'], ['XO_NFC', 'Expands_On_NFC'], ['XO_NFD', 'Expands_On_NFD'], ['XO_NFKC', 'Expands_On_NFKC'], ['XO_NFKD', 'Expands_On_NFKD'] ]); unicode-property-aliases-1.3.0/package.json000066400000000000000000000017551324360577500207540ustar00rootroot00000000000000{ "name": "unicode-property-aliases", "version": "1.3.0", "description": "Unicode property alias mappings in JavaScript format.", "homepage": "https://github.com/mathiasbynens/unicode-property-aliases", "main": "index.js", "engines": { "node": ">=4" }, "files": [ "LICENSE-MIT.txt", "index.js" ], "keywords": [ "unicode", "unicode-data", "alias", "aliases", "property alias" ], "license": "MIT", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, "repository": { "type": "git", "url": "https://github.com/mathiasbynens/unicode-property-aliases.git" }, "bugs": "https://github.com/mathiasbynens/unicode-property-aliases/issues", "devDependencies": { "ava": "*", "jsesc": "^2.0.0" }, "scripts": { "download": "curl https://unicode.org/Public/11.0.0/ucd/PropertyAliases-11.0.0d16.txt > data/PropertyAliases.txt", "build": "node scripts/build.js", "test": "ava ./tests" } } unicode-property-aliases-1.3.0/scripts/000077500000000000000000000000001324360577500201455ustar00rootroot00000000000000unicode-property-aliases-1.3.0/scripts/build.js000066400000000000000000000017321324360577500216050ustar00rootroot00000000000000'use strict'; const fs = require('fs'); const jsesc = require('jsesc'); const parsePropertyAliases = function() { const map = new Map(); const source = fs.readFileSync('./data/PropertyAliases.txt', 'utf8'); const lines = source.split('\n'); lines.forEach(function(line) { if (!line || /^#/.test(line)) { return; } const data = line.trim().split(';'); const alias1 = data[0].trim(); const canonicalName = data[1].trim(); console.assert(!map.has(alias1)); map.set(alias1, canonicalName); const remaining = data.slice(2); for (const otherAliasData of remaining) { const otherAlias = otherAliasData.trim(); console.assert(!map.has(otherAlias)); map.set(otherAlias, canonicalName); } }); return map; }; const map = parsePropertyAliases(); const header = '// Generated using `npm run build`. Do not edit!'; const output = `${ header }\nmodule.exports = ${ jsesc(map, { 'compact': false }) };\n`; require('fs').writeFileSync('./index.js', output); unicode-property-aliases-1.3.0/tests/000077500000000000000000000000001324360577500176205ustar00rootroot00000000000000unicode-property-aliases-1.3.0/tests/tests.js000066400000000000000000000010211324360577500213120ustar00rootroot00000000000000import test from 'ava'; import propertyAliases from '../index.js'; test(t => { t.is( propertyAliases.get('scf'), 'Simple_Case_Folding' ); t.is( propertyAliases.get('sfc'), 'Simple_Case_Folding' ); t.is( propertyAliases.get('cjkRSUnicode'), 'kRSUnicode' ); t.is( propertyAliases.get('Unicode_Radical_Stroke'), 'kRSUnicode' ); t.is( propertyAliases.get('URS'), 'kRSUnicode' ); t.is( propertyAliases.get('WSpace'), 'White_Space' ); t.is( propertyAliases.get('space'), 'White_Space' ); });