[Utils > unfreeze] Add

This commit is contained in:
Beef 2023-01-17 08:02:27 +00:00
parent a9cc702956
commit 19359529e9

View file

@ -0,0 +1,8 @@
// https://stackoverflow.com/a/68339174
export function unfreeze(obj: object) {
if (Object.isFrozen(obj)) {
return Object.assign({}, obj);
}
return obj;
}