MCPcopy
hub / github.com/formatjs/formatjs / char

Method char

packages/icu-messageformat-parser/parser.ts:1138–1148  ·  view source on GitHub ↗

* Return the code point at the current position of the parser. * Throws if the index is out of bound.

()

Source from the content-addressed store, hash-verified

1136 * Throws if the index is out of bound.
1137 */
1138 private char(): number {
1139 const offset = this.position.offset
1140 if (offset >= this.message.length) {
1141 throw Error('out of bound')
1142 }
1143 const code = this.message.codePointAt(offset)
1144 if (code === undefined) {
1145 throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`)
1146 }
1147 return code
1148 }
1149
1150 private error(
1151 kind: ErrorKind,

Callers 13

parseMessageMethod · 0.95
parseTagMethod · 0.95
parseTagNameMethod · 0.95
tryParseQuoteMethod · 0.95
tryParseUnquotedMethod · 0.95
parseArgumentMethod · 0.95
tryParseArgumentCloseMethod · 0.95
bumpMethod · 0.95
bumpSpaceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected