MCPcopy Create free account
hub / github.com/cortexkit/magic-context / readString

Function readString

packages/plugin/src/shared/error-message.ts:35–39  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

33}
34
35function readString(value: unknown): string | undefined {
36 if (typeof value === "string" && value.length > 0) return value;
37 if (typeof value === "number") return String(value);
38 return undefined;
39}
40
41function clip(value: string, max: number): string {
42 if (value.length <= max) return value;

Callers 1

describeErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected