TypeScript Version:
nightly (1.9.0-dev.20160521.01)
Code
Currently JSON.stringify is defined as:
stringify(value: any): string;
stringify(value: any, replacer: (key: string, value: any) => any): string;
stringify(value: any, replacer: any[]): string;
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
stringify(value: any, replacer: any[], space: string | number): string;
which makes it impossible to provide space argument without replacer if strictNullChecks is on:
JSON.stringify(value, undefined, 2)
Perhaps, another signature can be added or replacer can be made | undefined?
TypeScript Version:
nightly (1.9.0-dev.20160521.01)
Code
Currently
JSON.stringifyis defined as:which makes it impossible to provide
spaceargument withoutreplacerif strictNullChecks is on:Perhaps, another signature can be added or replacer can be made
| undefined?