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
This commit is contained in:
Joey Perrott 2021-02-04 14:17:17 -08:00 committed by Alex Rickabaugh
parent 350dadab73
commit 7ecfd2d7ed
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ describe('escape/unescape', () => {
'{&q;testString&q;:&q;&l;/script&g;&l;script&g;' + '{&q;testString&q;:&q;&l;/script&g;&l;script&g;' +
'alert(&s;Hello&a;&s; + \\&q;World\\&q;);&q;}'); '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); expect(unescapedObj['testString']).toBe(testString);
}); });
}); });