• 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/date-in-schema.ts
1
import { z } from "zod";
4✔
2

3
export const ezDateInBrand = Symbol("DateIn");
4✔
4

5
export const dateIn = () => {
4✔
6
  const schema = z.union([
52✔
7
    z.iso.date(),
52✔
8
    z.iso.datetime(),
52✔
9
    z.iso.datetime({ local: true }),
52✔
10
  ]) as z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>; // this fixes DTS build for ez export
52✔
11

12
  return schema
52✔
13
    .transform((str) => new Date(str))
52✔
14
    .pipe(z.date())
52✔
15
    .brand(ezDateInBrand as symbol);
52✔
16
};
52✔
17

18
export type DateInSchema = ReturnType<typeof dateIn>;
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