@yozora/character
v2.4.0
Published
Downloads
32,510
Readme
Character primitives used by Yozora tokenizers: code-point constants, character predicates, source-position tracking, entity references, and Unicode case folding.
Install
npm install --save @yozora/characterUsage
import {
createNodePointGenerator,
foldCase,
isPunctuationCharacter,
} from '@yozora/character'
const points = [...createNodePointGenerator('Hello, 世界')]
const identifier = foldCase('Yozora')
const commaIsPunctuation = isPunctuationCharacter(','.codePointAt(0)!)Key exports include:
AsciiCodePoint, Unicode category enums, andVirtualCodePoint- ASCII/Unicode whitespace, punctuation, control, digit, and letter predicates
createNodePointGeneratorand helpers for reading text from node-point intervals- named and numeric entity-reference parsing
foldCase,stripChineseCharacters, andtightenChineseCharacters
