aboutsummaryrefslogtreecommitdiff
path: root/src/utils/misc.tsx
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-09-05 20:10:42 +0200
committerV <vendicated@riseup.net>2023-09-05 20:10:42 +0200
commit8614e176334232fb5288a5b3255d2daa8245061a (patch)
tree3d225b6d9e17b01be7b4cc059b8f45989a2bcea3 /src/utils/misc.tsx
parentaecd9d8fda932cc2229a84a45937877b20625758 (diff)
downloadVencord-8614e176334232fb5288a5b3255d2daa8245061a.tar.gz
Vencord-8614e176334232fb5288a5b3255d2daa8245061a.tar.bz2
Vencord-8614e176334232fb5288a5b3255d2daa8245061a.zip
Fix some plugins wrongly displaying the settings cog
Diffstat (limited to 'src/utils/misc.tsx')
-rw-r--r--src/utils/misc.tsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/misc.tsx b/src/utils/misc.tsx
index ec612a9..2b8ccf8 100644
--- a/src/utils/misc.tsx
+++ b/src/utils/misc.tsx
@@ -75,6 +75,16 @@ export function isObject(obj: unknown): obj is object {
}
/**
+ * Check if an object is empty or in other words has no own properties
+ */
+export function isObjectEmpty(obj: object) {
+ for (const k in obj)
+ if (Object.hasOwn(obj, k)) return false;
+
+ return true;
+}
+
+/**
* Returns null if value is not a URL, otherwise return URL object.
* Avoids having to wrap url checks in a try/catch
*/