• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobinTail / express-zod-api / 14713214501

28 Apr 2025 04:48PM UTC coverage: 100.0%. Remained the same
14713214501

Pull #2589

github

web-flow
Merge 122705e67 into df75b154a
Pull Request #2589: Deep checks using `toJSONSchema`

1187 of 1228 branches covered (96.66%)

88 of 88 new or added lines in 4 files covered. (100.0%)

4034 of 4034 relevant lines covered (100.0%)

253.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/express-zod-api/src/depends-on-method.ts
1
import * as R from "ramda";
4✔
2
import { AbstractEndpoint } from "./endpoint";
3
import { Method } from "./method";
4
import { Routable } from "./routable";
4✔
5

6
export class DependsOnMethod extends Routable {
4✔
7
  readonly #endpoints: ConstructorParameters<typeof DependsOnMethod>[0];
44✔
8

9
  constructor(endpoints: Partial<Record<Method, AbstractEndpoint>>) {
44✔
10
    super();
44✔
11
    this.#endpoints = endpoints;
44✔
12
  }
44✔
13

14
  /**
15
   * @desc [method, endpoint, siblingMethods]
16
   * @internal
17
   * */
18
  public get entries(): ReadonlyArray<[Method, AbstractEndpoint, Method[]]> {
44✔
19
    const entries: Array<(typeof this.entries)[number]> = [];
40✔
20
    const methods = R.keys(this.#endpoints); // eslint-disable-line no-restricted-syntax -- literal type required
40✔
21
    for (const method of methods) {
40✔
22
      const endpoint = this.#endpoints[method];
80✔
23
      if (endpoint)
80✔
24
        entries.push([method, endpoint, R.reject(R.equals(method), methods)]);
80✔
25
    }
80✔
26
    return Object.freeze(entries);
40✔
27
  }
40✔
28

29
  public override deprecated() {
44✔
30
    const deprecatedEndpoints = Object.entries(this.#endpoints).reduce(
4✔
31
      (agg, [method, endpoint]) =>
4✔
32
        Object.assign(agg, { [method]: endpoint.deprecated() }),
4✔
33
      {} as ConstructorParameters<typeof DependsOnMethod>[0],
4✔
34
    );
4✔
35
    return new DependsOnMethod(deprecatedEndpoints) as this;
4✔
36
  }
4✔
37
}
44✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc