MCPcopy Index your code
hub / github.com/TanStack/ai / requireNonEmptyString

Function requireNonEmptyString

packages/ai-sandbox-cloudflare/src/protocol.ts:106–115  ·  view source on GitHub ↗
(
  value: Record<string, unknown>,
  key: string,
)

Source from the content-addressed store, hash-verified

104}
105
106function requireNonEmptyString(
107 value: Record<string, unknown>,
108 key: string,
109): string {
110 const found = value[key]
111 if (typeof found !== 'string' || found === '') {
112 throw new Error(`run request: ${key} must be a non-empty string`)
113 }
114 return found
115}
116
117/**
118 * Narrow an unknown `POST /run` body into a {@link ContainerRunRequest} (project

Callers 1

parseContainerRunRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected