Home > tsbuffer > TSBuffer > decodeJSON
从 JSON Object 解码,根据协议将 ArrayBuffer、Date、ObjectId 等类型从 JSON 中还原
Signature:
decodeJSON<T = unknown>(json: any, schemaOrId: string | TSBufferSchema, options?: DecodeOptions): DecodeOutput<T>;
Parameter | Type | Description |
---|---|---|
json | any | JSON Object (是 JSON 对象,而非 JSON 字符串) |
schemaOrId | string | TSBufferSchema | |
options | DecodeOptions | (Optional) |
Returns:
DecodeOutput<T>