@sapphire/utilities
Version:
Common JavaScript utilities for the Sapphire Community
9 lines (7 loc) • 425 B
text/typescript
/**
* Try parse a stringified JSON string.
* @param value The string to parse as JSON.
* @param reviver A function that transforms the results. This function is recursively called for each member of the object.
*/
declare function tryParseJSON(value: string, reviver?: (this: object, key: string, value: unknown) => unknown): object | string | number | boolean | null;
export { tryParseJSON as tryParse, tryParseJSON };