From 7f53d0aa57fe66ab62b7df70e0450402d16d2386 Mon Sep 17 00:00:00 2001 From: Antoine Lepee Date: Thu, 30 Aug 2018 14:17:26 +0200 Subject: [PATCH] js-cookie: JSON.parse return any --- types/js-cookie/index.d.ts | 5 +++-- types/js-cookie/js-cookie-tests.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/js-cookie/index.d.ts b/types/js-cookie/index.d.ts index f587e1df88..6cd3c89169 100644 --- a/types/js-cookie/index.d.ts +++ b/types/js-cookie/index.d.ts @@ -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 // BendingBender +// Antoine Lépée // 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 diff --git a/types/js-cookie/js-cookie-tests.ts b/types/js-cookie/js-cookie-tests.ts index 7b68951c87..683b401d8b 100644 --- a/types/js-cookie/js-cookie-tests.ts +++ b/types/js-cookie/js-cookie-tests.ts @@ -24,7 +24,7 @@ Cookies2; // $ExpectType CookiesStatic Cookies.set('name', { foo: 'bar' }); -// $ExpectType object +// $ExpectType any Cookies.getJSON('name'); // $ExpectType { [key: string]: any; }