MCPcopy Index your code
hub / github.com/simstudioai/sim / jsonResponse

Function jsonResponse

apps/sim/app/api/providers/baseten/models/route.test.ts:46–55  ·  view source on GitHub ↗
(body: unknown, init: { ok?: boolean; status?: number } = {})

Source from the content-addressed store, hash-verified

44const BASETEN_MODELS_URL = 'https://inference.baseten.co/v1/models'
45
46function jsonResponse(body: unknown, init: { ok?: boolean; status?: number } = {}): Response {
47 const status = init.status ?? 200
48 const ok = init.ok ?? (status >= 200 && status < 300)
49 return {
50 ok,
51 status,
52 statusText: ok ? 'OK' : 'Error',
53 json: vi.fn(async () => body),
54 } as unknown as Response
55}
56
57function setEnvKey(value: string | undefined): void {
58 mutableEnv.BASETEN_API_KEY = value

Callers 1

route.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected