properties

Holds data for unicode property names and values. Many of the names, aliases, and valid set of values are extracted from the raw unicode source. The actual codepoint data comes from the node-unicode library.

Members

(static, constant) names :PropertyIndex

Raw index of property names and values

Type:
  • PropertyIndex

Methods

(async, static) get(name, valuenullable) → {Promise.<PropertyCharacters>}

Fetch character data given by the unicode property name-value pair. This will throw an error if the name-value pair is unknown.

Parameters:
NameTypeAttributesDescription
namestring

property name, or if value is ommitted, it can be the property value for General Category or Script properties

valuestring<nullable>

property value; this can be blank, if name is a property value for General Category or Script properties, as mentioned above; otherwise, it defaults to "true", which will be a valid value for binary properties, but error for others

Returns:
Type: 
Promise.<PropertyCharacters>

(async, static) load()

Lazily load the index of property names and values. The individual unicode codepoints for each are lazily loaded as they are needed

Type Definitions

PropertyCharacters

Unicode characters associated with a property name-value pair

Type:
  • object
Properties
NameTypeDescription
groupCodepoints

container for characters

invertboolean

whether the group should be inverted (take the complement) to meet the property name-value criteria; this can be set for binary properties

PropertyIndex

Property name/value index structure

Type:
  • object
Properties
NameTypeDescription
shorthandobject.<string, string>

Map of property name to its shorthand alias

valuesobject.<string, object.<string, string>>

For each shorthand property name, a map of property value its shorthand alias

codepointsobject.<string, object.<string, Codepoints>>

For each property name a map of property value to Codepoints data