How to use unicode-property-value-aliases - 4 common examples

To help you get started, we’ve selected a few unicode-property-value-aliases examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathiasbynens / node-unicode-data / scripts / parse-script-extensions.js View on Github external
'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]);
github mathiasbynens / node-unicode-data / scripts / parse-line-break.js View on Github external
'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) {
github mathiasbynens / node-unicode-data / scripts / parse-categories.js View on Github external
'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);
github mathiasbynens / node-unicode-data / scripts / parse-categories.js View on Github external
'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];

unicode-property-value-aliases

Unicode property value alias mappings in JavaScript format.

MIT
Latest version published 2 months ago

Package Health Score

63 / 100
Full package analysis

Popular unicode-property-value-aliases functions