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:
parent
350dadab73
commit
7ecfd2d7ed
|
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue