Merge pull request #28529 from alepee/js-cookie-getJSON-return-any

[js-cookie] JSON.parse can return any types
This commit is contained in:
Mine Starks
2018-09-06 11:28:58 -07:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
// Type definitions for js-cookie 2.1
// Type definitions for js-cookie 2.2
// Project: https://github.com/js-cookie/js-cookie
// Definitions by: Theodore Brown <https://github.com/theodorejb>
// BendingBender <https://github.com/BendingBender>
// Antoine Lépée <https://github.com/alepee>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -57,7 +58,7 @@ declare namespace Cookies {
* Returns the parsed representation of the string
* stored in the cookie according to JSON.parse
*/
getJSON(name: string): object;
getJSON(name: string): any;
/**
* Returns the parsed representation of
+1 -1
View File
@@ -24,7 +24,7 @@ Cookies2; // $ExpectType CookiesStatic
Cookies.set('name', { foo: 'bar' });
// $ExpectType object
// $ExpectType any
Cookies.getJSON('name');
// $ExpectType { [key: string]: any; }