From 4f2a6b98510a24823ddeaaaeca178d4d59757ceb Mon Sep 17 00:00:00 2001 From: "Ahmed M.Kamal" Date: Tue, 5 Mar 2019 06:51:07 +0200 Subject: [PATCH 1/3] Update lib.es5.d.ts Update JSON.parse to accept optional type parameter and return this type "any by default" --- lib/lib.es5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index dda476e4e3957..d632a4ccda8d3 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -1056,7 +1056,7 @@ interface JSON { * @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. */ - parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; + parse(text: string, reviver?: (this: any, key: string, value: any) => any): T; /** * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. * @param value A JavaScript value, usually an object or array, to be converted. From 096da925b6ac55701d2b51b2ea603323e4473745 Mon Sep 17 00:00:00 2001 From: AhmedMKamal Date: Tue, 5 Mar 2019 07:07:24 +0200 Subject: [PATCH 2/3] update src instead of lib --- src/lib/es5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 4112f5a2ae7d7..b9fc27ca1d3ce 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1036,7 +1036,7 @@ interface JSON { * @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. */ - parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; + parse(text: string, reviver?: (this: any, key: string, value: any) => any): T; /** * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. * @param value A JavaScript value, usually an object or array, to be converted. From 9de9bfd817d9bcf07d48a27e0ddd7474c3078af8 Mon Sep 17 00:00:00 2001 From: AhmedMKamal Date: Tue, 5 Mar 2019 07:12:36 +0200 Subject: [PATCH 3/3] update src instead of lib --- lib/lib.es5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index d632a4ccda8d3..dda476e4e3957 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -1056,7 +1056,7 @@ interface JSON { * @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. */ - parse(text: string, reviver?: (this: any, key: string, value: any) => any): T; + parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; /** * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. * @param value A JavaScript value, usually an object or array, to be converted.