feat: 50% almost code coverage
This commit is contained in:
1 parent
9233f143c6
commit
7998e8fc2c
25 files changed
+393
-72
No files matched your search
@@ -1,3 +1,8 @@
|
||||
export const stringifyISODate = (date: Date|undefined): string => {
|
||||
return `${date?.toISOString()}`
|
||||
}
|
||||
|
||||
export const autoStringifyDateValues = ([key, value]: [string, unknown]): [string, unknown] => {
|
||||
console.log(key,value)
|
||||
return [key, typeof value === "object" && value instanceof Date ? stringifyISODate(value) : value]
|
||||
}
|
||||
@@ -3,6 +3,9 @@ import { z } from "zod";
|
||||
|
||||
const schemaApiKey = z
|
||||
.object({
|
||||
// We need to cast the date as strings as when we get it from the json response
|
||||
// we serve in api it is a string too (JSON doesn't directly support Date types)
|
||||
createdAt: z.date().optional().or(z.string().optional()),
|
||||
expiresAt: z.date().optional(), // default is 30 days
|
||||
note: z.string().min(1).optional(),
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user