MCPcopy Create free account
hub / github.com/Effect-TS/effect / handlersFixture

Function handlersFixture

packages/effect/typeperf/compare/httpapi.mjs:220–242  ·  view source on GitHub ↗
(count, raw = false)

Source from the content-addressed store, hash-verified

218 }))`
219
220const handlersFixture = (count, raw = false) => `// Compares chained builder ${raw ? "handleRaw" : "handle"} registration for ${count} same-shaped endpoints.
221${imports({ builder: true, effect: true })}
222
223${warmup}
224
225${schemas}
226
227const group = HttpApiGroup.make("users").add(
228${endpoints(count, " ")}
229)
230
231const api = HttpApi.make("Api").add(group)
232
233const layer = HttpApiBuilder.group(api, "users", (handlers) =>
234 handlers
235${Array.from({ length: count }, (_, index) => handlerCall(index + 1, raw)).join("\n")}
236)
237
238${assertions}
239
240export type LayerExists = Assert<IsNever<typeof layer> extends false ? true : false>
241export type Layer = typeof layer
242`
243
244export const httpapi = {
245 name: "httpapi",

Callers 1

httpapi.mjsFile · 0.85

Calls 4

endpointsFunction · 0.85
handlerCallFunction · 0.85
joinMethod · 0.80
importsFunction · 0.70

Tested by

no test coverage detected