refactor(platform-browser): cast response of JSON.parse (#41020)
Casts the response of JSON.parse to `{}`, so that is not an `any` type. This is because google3 does not allow the use of `any` type. PR Close #41020
This commit is contained in:
parent
198e841564
commit
3370ade9a4
@ -150,7 +150,8 @@ export function initTransferState(doc: Document, appId: string) {
|
|||||||
let initialState = {};
|
let initialState = {};
|
||||||
if (script && script.textContent) {
|
if (script && script.textContent) {
|
||||||
try {
|
try {
|
||||||
initialState = JSON.parse(unescapeHtml(script.textContent));
|
// Avoid using any here as it triggers lint errors in google3 (any is not allowed).
|
||||||
|
initialState = JSON.parse(unescapeHtml(script.textContent)) as {};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('Exception while restoring TransferState for app ' + appId, e);
|
console.warn('Exception while restoring TransferState for app ' + appId, e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user