Skip to content

Commit 96b02a8

Browse files
Merge pull request #3879 from Microsoft/stringifySpaceParam
Make JSON.stringify's 'space' parameter have type 'string | number'.
2 parents 8f2f84f + 79dcc43 commit 96b02a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/core.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -971,14 +971,14 @@ interface JSON {
971971
* @param replacer A function that transforms the results.
972972
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
973973
*/
974-
stringify(value: any, replacer: (key: string, value: any) => any, space: any): string;
974+
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
975975
/**
976976
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
977977
* @param value A JavaScript value, usually an object or array, to be converted.
978978
* @param replacer Array that transforms the results.
979979
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
980980
*/
981-
stringify(value: any, replacer: any[], space: any): string;
981+
stringify(value: any, replacer: any[], space: string | number): string;
982982
}
983983
/**
984984
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
@@ -1181,4 +1181,4 @@ interface PromiseLike<T> {
11811181
*/
11821182
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
11831183
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
1184-
}
1184+
}

0 commit comments

Comments
 (0)