mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #28529 from alepee/js-cookie-getJSON-return-any
[js-cookie] JSON.parse can return any types
This commit is contained in:
Vendored
+3
-2
@@ -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
|
||||
|
||||
@@ -24,7 +24,7 @@ Cookies2; // $ExpectType CookiesStatic
|
||||
|
||||
Cookies.set('name', { foo: 'bar' });
|
||||
|
||||
// $ExpectType object
|
||||
// $ExpectType any
|
||||
Cookies.getJSON('name');
|
||||
|
||||
// $ExpectType { [key: string]: any; }
|
||||
|
||||
Reference in New Issue
Block a user