diff --git a/src/lib/utils/unfreeze.ts b/src/lib/utils/unfreeze.ts new file mode 100644 index 0000000..1e12e44 --- /dev/null +++ b/src/lib/utils/unfreeze.ts @@ -0,0 +1,8 @@ +// https://stackoverflow.com/a/68339174 + +export function unfreeze(obj: object) { + if (Object.isFrozen(obj)) { + return Object.assign({}, obj); + } + return obj; +} \ No newline at end of file