(async) new UnicodeSet(pattern) → {Promise.<RangeGroup>}
This does not need to be called with new
. Parses and evaluates a UnicodeSet string as a RangeGroup
. This is an async function as it will lazily load the unicode character name and property data as it is needed.
Name | Type | Description |
---|---|---|
pattern | string | pattern defining the unicode set |
- Source
- Type:
- Promise.<RangeGroup>
Members
(static) options :EvaluateOptions
Options to configure group evaluation
- EvaluateOptions
Methods
(static) evaluate(node) → {Promise.<RangeGroup>}
Takes an AST as generated from UnicodeSet.parse and evaluates as a RangeGroup
Name | Type | Description |
---|---|---|
node | object | AST node to evaluate |
- Type:
- Promise.<RangeGroup>
(static) lazyEvaluate(node) → {Promise.<LazyGroup>}
Takes an AST as generated from UnicodeSet.parse and evaluates it into a lazily evaluated group
Name | Type | Description |
---|---|---|
node | object | AST node to evaluate |
- Type:
- Promise.<LazyGroup>
(static) parse(pattern) → {Promise.<Node>}
Parse a UnicodeSet pattern into an abstract syntax tree (AST). Some trivial transformations are performed on the tree to reduce groups, combine invert/complement, and combine nodes. The parsing is async, as it lazily loads unicode data as it becomes needed.
Name | Type | Description |
---|---|---|
pattern | string | UnicodeSet pattern |
the AST root node
- Type:
- Promise.<Node>
Type Definitions
EvaluateOptions
Configurable constants for group evaluation
- object
Name | Type | Description |
---|---|---|
rebuild_threshold | number | Threshold for |
string_range_1d_max | number | Maximum 1D ranges that we allow to be generated from a single multidimensional (ND) string range. This is used to guard against unintended, huge memory usage. The |