fix(service-worker): update type castings for JSON.parse usage (#40710) · angular/angular@4f7ff96 · GitHub
Skip to content

Commit 4f7ff96

Browse files
josephperrottalxhub
authored andcommitted
fix(service-worker): update type castings for JSON.parse usage (#40710)
Update usages of JSON.parse to be cast as specific types. PR Close #40710
1 parent 2827845 commit 4f7ff96

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/service-worker/cli/main.ts

Lines changed: 3 additions & 2 deletions

packages/service-worker/worker/test/happy_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ describe('Driver', () => {
994994
const getClientAssignments = async (sw: SwTestHarness, baseHref: string) => {
995995
const cache = await sw.caches.open(`ngsw:${baseHref}:db:control`) as unknown as MockCache;
996996
const dehydrated = cache.dehydrate();
997-
return JSON.parse(dehydrated['/assignments'].body!);
997+
return JSON.parse(dehydrated['/assignments'].body!) as any;
998998
};
999999

10001000
const initializeSwFor = async (baseHref: string, initialCacheState = '{}') => {

packages/service-worker/worker/testing/fetch.ts

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)