@darkgl/slow-json-stringify
Version:
The fastest JSON stringifier
28 lines (27 loc) • 886 B
TypeScript
import type { _makeQueue } from './_makeQueue.js';
type JSONPrimitive = string | number | boolean | null;
type AttrType = 'string' | 'number' | 'boolean' | 'array' | 'null';
type SjsSchema = {
[prop: string]: AttrExecutable | SjsSchema;
};
type SjsSerializer = (obj: unknown) => string;
type SjsEscaper = (str: string) => string;
type AttrExecutable = object;
type Serializer = (raw: any) => JSONPrimitive | undefined;
type Queue = ReturnType<typeof _makeQueue>;
type PreparedSchema = {
[prop: string]: JSONPrimitive;
};
type QueueItem = {
serializer: Function;
find: Function;
name: string;
};
type Chunk = {
flag: boolean;
pure: string;
prevUndef: string;
isUndef: string;
bothUndef: string;
};
export type { AttrType, AttrExecutable, JSONPrimitive, SjsSchema, SjsSerializer, SjsEscaper, Serializer, Queue, PreparedSchema, QueueItem, Chunk, };