MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeProto

Function makeProto

packages/platform/src/HttpApi.ts:234–250  ·  view source on GitHub ↗
(
  options: {
    readonly identifier: Id
    readonly groups: Record.ReadonlyRecord<string, Groups>
    readonly errorSchema: Schema.Schema<E, I, R>
    readonly annotations: Context.Context<never>
    readonly middlewares: ReadonlySet<HttpApiMiddleware.TagClassAny>
  }
)

Source from the content-addressed store, hash-verified

232}
233
234const makeProto = <Id extends string, Groups extends HttpApiGroup.HttpApiGroup.Any, E, I, R>(
235 options: {
236 readonly identifier: Id
237 readonly groups: Record.ReadonlyRecord<string, Groups>
238 readonly errorSchema: Schema.Schema<E, I, R>
239 readonly annotations: Context.Context<never>
240 readonly middlewares: ReadonlySet<HttpApiMiddleware.TagClassAny>
241 }
242): HttpApi<Id, Groups, E, R> => {
243 function HttpApi() {}
244 Object.setPrototypeOf(HttpApi, Proto)
245 HttpApi.groups = options.groups
246 HttpApi.errorSchema = options.errorSchema
247 HttpApi.annotations = options.annotations
248 HttpApi.middlewares = options.middlewares
249 return HttpApi as any
250}
251
252/**
253 * An `HttpApi` is a collection of `HttpApiEndpoint`s. You can use an `HttpApi` to

Callers 8

addFunction · 0.70
addHttpApiFunction · 0.70
addErrorFunction · 0.70
prefixFunction · 0.70
middlewareFunction · 0.70
annotateFunction · 0.70
annotateContextFunction · 0.70
makeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected