2.6.0 • Published 9 months ago

unicode-loose-match v2.6.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 months ago

unicode-loose-match

unicode-loose-match is a JavaScript implementation of UAX44-LM3, i.e. the loose matching algorithm for symbolic values as defined in the Unicode Standard.

It’s based on Unicode data and recognizes property aliases and property value aliases.

Installation

To use unicode-loose-match programmatically, install it as a dependency via npm:

$ npm install unicode-loose-match

Then, require it:

const matchLoosely = require('unicode-loose-match');

API

This module exports a single function named matchLoosely.

matchLoosely(propertyInput, [valueInput])

This function takes two strings propertyInput and valueInput and applies loose matching on the property-value pair within the list of all Unicode property values. valueInput is optional.

The return value is an object containing containing the canonical property name property and the canonical property value name value. If an unknown propertyInput is given, an exception is thrown.

// Find the canonical property name and property value name:
matchLoosely('blk', 'Arabic_PF_B')
// → { 'property': 'Block', 'value': 'Arabic_Presentation_Forms_B' }

// Find the canonical property name:
matchLoosely('compex')
// → { 'property': 'Full_Composition_Exclusion' }

Author

twitter/mathias
Mathias Bynens

License

unicode-loose-match is available under the MIT license.

2.6.0

9 months ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.1

7 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago