Skip to content

Commit 78bf697

Browse files
committed
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
1 parent e3ccd56 commit 78bf697

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/platform-browser/src/browser/transfer_state.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ export function initTransferState(doc: Document, appId: string) {
150150
let initialState = {};
151151
if (script && script.textContent) {
152152
try {
153-
initialState = JSON.parse(unescapeHtml(script.textContent));
153+
// Avoid using any here as it triggers lint errors in google3 (any is not allowed).
154+
initialState = JSON.parse(unescapeHtml(script.textContent)) as {};
154155
} catch (e) {
155156
console.warn('Exception while restoring TransferState for app ' + appId, e);
156157
}

0 commit comments

Comments
 (0)