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

RobinTail / express-zod-api / 10256993677

05 Aug 2024 10:32PM UTC coverage: 100.0%. Remained the same
10256993677

Pull #1970

github

web-flow
Merge f6cda697c into 8c3b0a307
Pull Request #1970: Bump typescript-eslint from 8.0.0 to 8.0.1

761 of 798 branches covered (95.36%)

1194 of 1194 relevant lines covered (100.0%)

435.71 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