@terascope/utils / json
json
Functions
parseJSON()
parseJSON<
T>(buf):T
Defined in: packages/utils/src/json.ts:15
JSON encoded buffer into a json object
Type Parameters
| Type Parameter | Default type |
|---|---|
T | Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
buf | string | Buffer<ArrayBufferLike> |
Returns
T
toJSONCompatibleValue()
toJSONCompatibleValue(
input):any
Defined in: packages/utils/src/json.ts:33
This will try to convert any BigInt values to a value that is compatible with JSON, it will iterate through an array, and check all the keys of an object
Parameters
| Parameter | Type |
|---|---|
input | unknown |
Returns
any
tryParseJSON()
tryParseJSON<
T>(input):T
Defined in: packages/utils/src/json.ts:6
Type Parameters
| Type Parameter | Default type |
|---|---|
T | any |
Parameters
| Parameter | Type |
|---|---|
input | unknown |
Returns
T