Fix some plugins wrongly displaying the settings cog

This commit is contained in:
V 2023-09-05 20:10:42 +02:00
parent aecd9d8fda
commit 8614e17633
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
3 changed files with 14 additions and 4 deletions

View file

@ -74,6 +74,16 @@ export function isObject(obj: unknown): obj is object {
return typeof obj === "object" && obj !== null && !Array.isArray(obj);
}
/**
* 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