@jswalden/streaming-json
Version:
Streaming JSON parsing and stringification for JavaScript/TypeScript
45 lines (44 loc) • 1.2 kB
TypeScript
/**
* Various Unicode code point values as inlinable constants.
*
* Because this is a `const enum`, values are inlined at point of use.
* Unfortunately uses typically must be explicitly cast to `number` to avoid
* `enum` comparison warnings. Such is life.
*/
export declare const enum Unicode {
HT = 9,
LF = 10,
CR = 13,
SP = 32,
QuotationMark = 34,
Plus = 43,
Comma = 44,
Dash = 45,
Period = 46,
ForwardSlash = 47,
Zero = 48,
Nine = 57,
Colon = 58,
LargeLetterA = 65,
LargeLetterE = 69,
LargeLetterF = 70,
OpenBracket = 91,
Backslash = 92,
CloseBracket = 93,
SmallLetterA = 97,
SmallLetterB = 98,
SmallLetterF = 102,
SmallLetterN = 110,
SmallLetterR = 114,
SmallLetterT = 116,
SmallLetterU = 117,
OpenBrace = 123,
CloseBrace = 125
}
/** Return true iff the supplied character code is an ASCII decimal digit. */
export declare function IsAsciiDigit(c: number): boolean;
/**
* Convert `fragment[i]` to the number it encodes as hex digit. If it doesn't
* encode a hex digit, return `null`.
*/
export declare function HexDigitToNumber(fragment: string, i: number): number | null;