blob: 8b6b613151dd6eea4747afac7eb3c08c16cfa7a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
function structuredCloneImpl(val: any, visited: WeakMap<any, boolean>): any {
// FIXME: replace with real implementation!
return JSON.parse(JSON.stringify(val));
}
/**
* Structured clone for IndexedDB.
*/
export function structuredClone(val: any): any {
const visited: WeakMap<any, boolean> = new WeakMap<any, boolean>();
return structuredCloneImpl(val, visited);
}
export default structuredClone;
|