Current section

Files

Jump to
ckeditor5_phoenix dist shared parse-json-if-present.d.ts
Raw

dist/shared/parse-json-if-present.d.ts

/**
* Parses a JSON string if it is provided.
*
* Returns `null` when the input is `null`, `undefined` or an empty string.
* Otherwise it parses the string using `JSON.parse` and returns the parsed value.
*
* @throws SyntaxError when the input is not valid JSON.
*/
export declare function parseJsonIfPresent<T = unknown>(json: string | null | undefined): T | null;
//# sourceMappingURL=parse-json-if-present.d.ts.map