CodePointSet
Defined in: src/unicode/code-point-set.ts:86
A resolved set of code points to draw from.
The string functions resolve and cache one of these per distinct set of
options, so build one yourself only to hold onto it explicitly or to use
at and size.
Example
Section titled “Example”const kana = new CodePointSet({ blocks: ["hiragana", "katakana"] });kana.size; // 189kana.at(0); // 12353, the first code point in the set
char(kana); // "ネ"chars(8, kana);Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CodePointSet(
options?):CodePointSet
Defined in: src/unicode/code-point-set.ts:94
Parameters
Section titled “Parameters”options?
Section titled “options?”UnicodeOptions = {}
Returns
Section titled “Returns”CodePointSet
Properties
Section titled “Properties”ranges
Section titled “ranges”
readonlyranges: readonlyCodePointRange[]
Defined in: src/unicode/code-point-set.ts:87
readonlysize:number
Defined in: src/unicode/code-point-set.ts:89
How many code points the set holds, ignoring any filter.
Methods
Section titled “Methods”at(
index):number
Defined in: src/unicode/code-point-set.ts:132
The index-th code point, counting across all ranges in order.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number
pick()
Section titled “pick()”pick(
src):number
Defined in: src/unicode/code-point-set.ts:151
One uniformly chosen code point.
Parameters
Section titled “Parameters”Source
Returns
Section titled “Returns”number