Remove 'unfreeze'

This commit is contained in:
amsyarasyiq 2024-03-07 01:27:57 +08:00
parent 3692cc41c8
commit d93439d911
3 changed files with 1 additions and 8 deletions

View file

@ -71,7 +71,7 @@ export const createVendettaObject = (unloads: any[]): any => ({
findInReactTree: (tree: { [key: string]: any; }, filter: any) => utils.findInReactTree(tree, filter),
findInTree: (tree: any, filter: any, options: any) => utils.findInTree(tree, filter, options),
safeFetch: (input: RequestInfo | URL, options?: RequestInit | undefined, timeout?: number | undefined) => utils.safeFetch(input, options, timeout),
unfreeze: (obj: object) => utils.unfreeze(obj),
unfreeze: (obj: object) => ({ ...obj }),
without: (object: any, ...keys: any) => utils.without(object, ...keys)
},
debug: {

View file

@ -7,5 +7,4 @@ export { findInTree } from "@lib/utils/findInTree";
export * as logger from "@lib/utils/logger";
export { safeFetch } from "@lib/utils/safeFetch";
export * as types from "@lib/utils/types";
export { unfreeze } from "@lib/utils/unfreeze";
export { without } from "@lib/utils/without";

View file

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