From 7ecfd2d7ed0dbc1c08629da9790ca7354fc7e4f2 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Thu, 4 Feb 2021 14:17:17 -0800 Subject: [PATCH] fix(platform-browser): update type castings for JSON.parse usage (#40710) Update usages of JSON.parse to be cast as specific types. PR Close #40710 --- packages/platform-browser/test/browser/transfer_state_spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/platform-browser/test/browser/transfer_state_spec.ts b/packages/platform-browser/test/browser/transfer_state_spec.ts index 8dc11802f9..3a6b1226f9 100644 --- a/packages/platform-browser/test/browser/transfer_state_spec.ts +++ b/packages/platform-browser/test/browser/transfer_state_spec.ts @@ -127,7 +127,7 @@ describe('escape/unescape', () => { '{&q;testString&q;:&q;&l;/script&g;&l;script&g;' + 'alert(&s;Hello&a;&s; + \\&q;World\\&q;);&q;}'); - const unescapedObj = JSON.parse(unescapeHtml(escaped)); + const unescapedObj = JSON.parse(unescapeHtml(escaped)) as {testString: string}; expect(unescapedObj['testString']).toBe(testString); }); });