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

RobinTail / express-zod-api / 11774601763

11 Nov 2024 08:11AM UTC coverage: 100.0%. Remained the same
11774601763

Pull #2163

github

web-flow
Merge f0bd6d2f1 into f628a2af1
Pull Request #2163: Bump @arethetypeswrong/cli from 0.16.4 to 0.17.0

1148 of 1168 branches covered (98.29%)

3900 of 3900 relevant lines covered (100.0%)

381.94 hits per line

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

100.0
/src/api-response.ts
1
import { z } from "zod";
2

3
export const defaultStatusCodes = {
6✔
4
  positive: 200,
6✔
5
  negative: 400,
6✔
6
} satisfies Record<string, number>;
6✔
7

8
export type ResponseVariant = keyof typeof defaultStatusCodes;
9

10
export interface ApiResponse<S extends z.ZodTypeAny> {
11
  schema: S;
12
  /**
13
   * @default 200 for a positive response
14
   * @default 400 for a negative response
15
   * @override statusCodes
16
   * */
17
  statusCode?: number;
18
  /**
19
   * @default [200] for positive response
20
   * @default [400] for negative response
21
   * */
22
  statusCodes?: [number, ...number[]];
23
  /**
24
   * @default "application/json"
25
   * @override mimeTypes
26
   * */
27
  mimeType?: string;
28
  /** @default [ "application/json" ] */
29
  mimeTypes?: [string, ...string[]];
30
}
31

32
export type NormalizedResponse = Required<
33
  Pick<ApiResponse<z.ZodTypeAny>, "schema" | "statusCodes" | "mimeTypes">
34
>;
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

© 2026 Coveralls, Inc