From 4108275946dabe097547afbc17fce7554e2f2568 Mon Sep 17 00:00:00 2001 From: Beef Date: Sat, 4 Feb 2023 02:37:36 +0000 Subject: [PATCH] [Utils > unfreeze] Actually expose --- src/def.d.ts | 1 + src/lib/utils/unfreeze.ts | 2 +- src/lib/windowObject.ts | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/def.d.ts b/src/def.d.ts index d8df96b..68fb37a 100644 --- a/src/def.d.ts +++ b/src/def.d.ts @@ -235,6 +235,7 @@ interface VendettaObject { copyText: (content: string) => void; findInReactTree: (tree: { [key: string]: any }, filter: SearchFilter) => void; findInTree: (tree: { [key: string]: any }, filter: SearchFilter, options: FindInTreeOptions) => any; + unfreeze: (obj: object) => object; }; debug: { connectToDebugger: (url: string) => void; diff --git a/src/lib/utils/unfreeze.ts b/src/lib/utils/unfreeze.ts index 1e12e44..3bcdbc7 100644 --- a/src/lib/utils/unfreeze.ts +++ b/src/lib/utils/unfreeze.ts @@ -1,6 +1,6 @@ // https://stackoverflow.com/a/68339174 -export function unfreeze(obj: object) { +export default function unfreeze(obj: object) { if (Object.isFrozen(obj)) { return Object.assign({}, obj); } diff --git a/src/lib/windowObject.ts b/src/lib/windowObject.ts index 197664b..4a4870f 100644 --- a/src/lib/windowObject.ts +++ b/src/lib/windowObject.ts @@ -5,6 +5,7 @@ import settings from "@lib/settings"; import copyText from "@utils/copyText"; import findInReactTree from "@utils/findInReactTree"; import findInTree from "@utils/findInTree"; +import unfreeze from "@utils/unfreeze"; import * as constants from "@lib/constants"; import * as debug from "@lib/debug"; import * as plugins from "@lib/plugins"; @@ -29,9 +30,10 @@ export default async function windowObject(unloads: any[]): Promise