unicode-match-property
Match a Unicode property or property alias to its canonical property name without loose matching.
Last updated 9 years ago by mathias .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install unicode-match-property 
SYNC missed versions from official npm registry.

unicode-match-property Build status

unicode-match-property matches a given Unicode property or property alias to its canonical property name without applying loose matching per the algorithm used for RegExp Unicode property escapes in ECMAScript. Consider it a strict alternative to loose matching.

Installation

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

$ npm install unicode-match-property

Then, require it:

const matchProperty = require('unicode-match-property');

API

This module exports a single function named matchProperty.

matchProperty(value)

This function takes a string value and attempts to match it to a canonical Unicode property name. If there’s a match, it returns the canonical property name. Otherwise, it throws an exception.

// Find the canonical property name:
matchProperty('sc')
// → 'Script'

matchProperty('Script')
// → 'Script'

matchProperty('script') // Note: incorrect casing.
// → throws

Author

twitter/mathias
Mathias Bynens

License

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

Current Tags

  • 0.2.2                                ...           latest (9 years ago)

7 Versions

  • 0.2.2                                ...           9 years ago
  • 0.2.1                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.1.3                                ...           9 years ago
  • 0.1.2                                ...           9 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 6
Last Month 1
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |