MCPcopy
hub / github.com/ecyrbe/zodios / addEndpoint

Method addEndpoint

src/api.ts:210–219  ·  view source on GitHub ↗
(
    endpoint: Narrow<E>
  )

Source from the content-addressed store, hash-verified

208export class Builder<T extends ZodiosEndpointDefinitions> {
209 constructor(private api: T) {}
210 addEndpoint<E extends ZodiosEndpointDefinition>(
211 endpoint: Narrow<E>
212 ): Builder<[...T, E]> {
213 if (this.api.length === 0) {
214 this.api = [endpoint] as T;
215 return this as any;
216 }
217 this.api = [...this.api, endpoint] as any;
218 return this as any;
219 }
220 build(): T {
221 checkApi(this.api!);
222 return this.api!;

Callers 3

api.test.tsFile · 0.80
articles.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected