Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Zoo-Code-Org/Zoo-Code
/ isRecord
Function
isRecord
apps/cli/src/lib/utils/guards.ts:1–3 ·
view source on GitHub ↗
(value: unknown)
Source
from the content-addressed store, hash-verified
1
export
function
isRecord(value: unknown): value is Record<string, unknown> {
2
return
typeof value ===
"object"
&& value !== null
3
}
Callers
8
onMessage
Function · 0.50
requestOpenRouterModels
Function · 0.50
parseStdinStreamCommand
Function · 0.50
parseQueueSnapshot
Function · 0.50
onExtensionMessage
Function · 0.50
getLatestCliVersion
Function · 0.50
{ it("defaults to json when undefined", () => { expect(parseFormat(undefined)).toBe("json") }) it("returns json for 'json'", () => { expect(parseFormat("json")).toBe("json") }) it("returns text for 'text'", () => { expect(parseFormat("text")).toBe("text") }) it("is case-insensitive", () => { expect(parseFormat("JSON")).toBe("json") expect(parseFormat("Text")).toBe("text") expect(parseFormat("TEXT")).toBe("text") }) it("throws on invalid format", () => { expect(() => parseFormat("xml")).toThrow('Invalid format: xml. Must be "json" or "text".') }) it("throws on empty string", () => { expect(() => parseFormat("")).toThrow("Invalid format") }) }
Function · 0.50
guards.test.ts
File · 0.50
Calls
no outgoing calls
Tested by
1
{ it("defaults to json when undefined", () => { expect(parseFormat(undefined)).toBe("json") }) it("returns json for 'json'", () => { expect(parseFormat("json")).toBe("json") }) it("returns text for 'text'", () => { expect(parseFormat("text")).toBe("text") }) it("is case-insensitive", () => { expect(parseFormat("JSON")).toBe("json") expect(parseFormat("Text")).toBe("text") expect(parseFormat("TEXT")).toBe("text") }) it("throws on invalid format", () => { expect(() => parseFormat("xml")).toThrow('Invalid format: xml. Must be "json" or "text".') }) it("throws on empty string", () => { expect(() => parseFormat("")).toThrow("Invalid format") }) }
Function · 0.40