Utils: `json`
Table of contents
Functions
Functions
parseJSON
▸ parseJSON<T
>(buf
): T
JSON encoded buffer into a json object
Type parameters
Name | Type |
---|---|
T | Record <string , unknown > |
Parameters
Name | Type | |
---|---|---|
buf | string \ | Buffer |
Returns
T
Defined in
toJSONCompatibleValue
▸ toJSONCompatibleValue(input
): any
This will try to convert any BigInt values to a value that is compatible with JSON, it will it will iterate through an array, and check all the keys of an object
Parameters
Name | Type |
---|---|
input | unknown |
Returns
any
Defined in
tryParseJSON
▸ tryParseJSON<T
>(input
): T
Type parameters
Name | Type |
---|---|
T | any |
Parameters
Name | Type |
---|---|
input | unknown |
Returns
T