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

RobinTail / express-zod-api / 14625934837

23 Apr 2025 06:57PM UTC coverage: 99.975%. Remained the same
14625934837

Pull #2573

github

web-flow
Merge 287b126f3 into 83dfadd5f
Pull Request #2573: Improve handling of `ZodError` by `ensureError`

1203 of 1240 branches covered (97.02%)

1 of 1 new or added line in 1 file covered. (100.0%)

4063 of 4064 relevant lines covered (99.98%)

258.26 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.string().date(),
52✔
8
    z.string().datetime(),
52✔
9
    z.string().datetime({ local: true }),
52✔
10
  ]);
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