MCPcopy Create free account
hub / github.com/agegr/pi-web / isObject

Function isObject

lib/normalize.ts:3–5  ·  view source on GitHub ↗
(val: unknown)

Source from the content-addressed store, hash-verified

1import type { AgentMessage, AssistantMessage, ToolCallContent } from "./types";
2
3function isObject(val: unknown): val is Record<string, unknown> {
4 return typeof val === "object" && val !== null && !Array.isArray(val);
5}
6
7function normalizeToolCallBlock(block: unknown): ToolCallContent | null {
8 if (!isObject(block) || block.type !== "toolCall") return null;

Callers 1

normalizeToolCallBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected