Skip to content

Commit

Permalink
fix: polyfill type
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Sep 13, 2023
1 parent 3fcb6cb commit 22b6db2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import { setup } from "@/utils/setup";

setup();
if (!globalThis.structuredClone) {
globalThis.structuredClone = function structuredClone(
objectToClone: unknown
) {
return JSON.parse(JSON.stringify(objectToClone)) as unknown;
globalThis.structuredClone = <T>(objectToClone: T) => {
return JSON.parse(JSON.stringify(objectToClone)) as T;
};
}
/**
Expand Down

0 comments on commit 22b6db2

Please sign in to comment.