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

RobinTail / express-zod-api / 10165166578

30 Jul 2024 03:21PM UTC coverage: 100.0%. First build
10165166578

Pull #1952

github

web-flow
Merge 44cc8988f into 99dd44e68
Pull Request #1952: Bump typescript-eslint from 8.0.0-alpha.58 to 8.0.0-alpha.59 in the typescript-eslint group

763 of 800 branches covered (95.38%)

1200 of 1200 relevant lines covered (100.0%)

433.61 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 = {
156✔
4
  positive: 200,
5
  negative: 400,
6
};
7

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

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