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

Function addHttpApi

packages/platform/src/HttpApi.ts:159–177  ·  view source on GitHub ↗
(
    this: HttpApi.AnyWithProps,
    api: HttpApi.AnyWithProps
  )

Source from the content-addressed store, hash-verified

157 })
158 },
159 addHttpApi(
160 this: HttpApi.AnyWithProps,
161 api: HttpApi.AnyWithProps
162 ) {
163 const newGroups = { ...this.groups }
164 for (const key in api.groups) {
165 const newGroup: Mutable<HttpApiGroup.HttpApiGroup.AnyWithProps> = api.groups[key].annotateContext(Context.empty())
166 newGroup.annotations = Context.merge(api.annotations, newGroup.annotations)
167 newGroup.middlewares = new Set([...api.middlewares, ...newGroup.middlewares])
168 newGroups[key] = newGroup as any
169 }
170 return makeProto({
171 identifier: this.identifier,
172 groups: newGroups,
173 errorSchema: HttpApiSchema.UnionUnify(this.errorSchema, api.errorSchema),
174 annotations: this.annotations,
175 middlewares: this.middlewares
176 })
177 },
178 addError(
179 this: HttpApi.AnyWithProps,
180 schema: Schema.Schema.Any,

Callers

nothing calls this directly

Calls 3

mergeMethod · 0.80
makeProtoFunction · 0.70
annotateContextMethod · 0.65

Tested by

no test coverage detected