Skip to content

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.

const kana = new CodePointSet({ blocks: ["hiragana", "katakana"] });
kana.size; // 189
kana.at(0); // 12353, the first code point in the set
char(kana); // "ネ"
chars(8, kana);

new CodePointSet(options?): CodePointSet

Defined in: src/unicode/code-point-set.ts:94

UnicodeOptions = {}

CodePointSet

readonly ranges: readonly CodePointRange[]

Defined in: src/unicode/code-point-set.ts:87


readonly size: number

Defined in: src/unicode/code-point-set.ts:89

How many code points the set holds, ignoring any filter.

at(index): number

Defined in: src/unicode/code-point-set.ts:132

The index-th code point, counting across all ranges in order.

number

number


pick(src): number

Defined in: src/unicode/code-point-set.ts:151

One uniformly chosen code point.

Source

number