MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / isEmpty

Function isEmpty

src/utils/object.ts:6–18  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

4 * @returns true if the object is empty, false otherwise
5 */
6export function isEmpty(obj: unknown): boolean {
7 if (!obj || typeof obj !== "object") {
8 return true
9 }
10
11 // Check if it's an array
12 if (Array.isArray(obj)) {
13 return obj.length === 0
14 }
15
16 // Check if it's an object with no own properties
17 return Object.keys(obj).length === 0
18}

Callers 2

object.spec.tsFile · 0.90
getPromptComponentFunction · 0.90

Calls 1

keysMethod · 0.65

Tested by

no test coverage detected