[Utils > unfreeze] Actually expose

This commit is contained in:
Beef 2023-02-04 02:37:36 +00:00
parent 0ba9ee600c
commit 4108275946
3 changed files with 7 additions and 4 deletions

1
src/def.d.ts vendored
View file

@ -235,6 +235,7 @@ interface VendettaObject {
copyText: (content: string) => void; copyText: (content: string) => void;
findInReactTree: (tree: { [key: string]: any }, filter: SearchFilter) => void; findInReactTree: (tree: { [key: string]: any }, filter: SearchFilter) => void;
findInTree: (tree: { [key: string]: any }, filter: SearchFilter, options: FindInTreeOptions) => any; findInTree: (tree: { [key: string]: any }, filter: SearchFilter, options: FindInTreeOptions) => any;
unfreeze: (obj: object) => object;
}; };
debug: { debug: {
connectToDebugger: (url: string) => void; connectToDebugger: (url: string) => void;

View file

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

View file

@ -5,6 +5,7 @@ import settings from "@lib/settings";
import copyText from "@utils/copyText"; import copyText from "@utils/copyText";
import findInReactTree from "@utils/findInReactTree"; import findInReactTree from "@utils/findInReactTree";
import findInTree from "@utils/findInTree"; import findInTree from "@utils/findInTree";
import unfreeze from "@utils/unfreeze";
import * as constants from "@lib/constants"; import * as constants from "@lib/constants";
import * as debug from "@lib/debug"; import * as debug from "@lib/debug";
import * as plugins from "@lib/plugins"; import * as plugins from "@lib/plugins";
@ -29,9 +30,10 @@ export default async function windowObject(unloads: any[]): Promise<VendettaObje
metro: { ...metro, common: { ...common } }, metro: { ...metro, common: { ...common } },
constants: { ...constants }, constants: { ...constants },
utils: { utils: {
copyText: copyText, copyText,
findInReactTree: findInReactTree, findInReactTree,
findInTree: findInTree, findInTree,
unfreeze,
}, },
debug: without(debug, "versionHash", "patchLogHook"), debug: without(debug, "versionHash", "patchLogHook"),
ui: { ui: {