docs(lib): add @throws JSDoc for JSON methods (#61596)

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
Joseph Martin 2025-05-03 00:20:58 +02:00 committed by GitHub
parent 5e36778330
commit d88d3a4681
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

3
src/lib/es5.d.ts vendored
View File

@ -1140,6 +1140,7 @@ interface JSON {
* @param text A valid JSON string.
* @param reviver A function that transforms the results. This function is called for each member of the object.
* If a member contains nested objects, the nested objects are transformed before the parent object is.
* @throws {SyntaxError} If `text` is not valid JSON.
*/
parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
/**
@ -1147,6 +1148,7 @@ interface JSON {
* @param value A JavaScript value, usually an object or array, to be converted.
* @param replacer A function that transforms the results.
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
* @throws {TypeError} If a circular reference or a BigInt value is found.
*/
stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
/**
@ -1154,6 +1156,7 @@ interface JSON {
* @param value A JavaScript value, usually an object or array, to be converted.
* @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
* @throws {TypeError} If a circular reference or a BigInt value is found.
*/
stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
}