Skip to content

Commit 71515f6

Browse files
committed
fix: stringify filter-date validation errors
1 parent 82aab91 commit 71515f6

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎packages/ccusage/src/_shared-args.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ function parseDateArg(value: string): string {
1414
const result = v.safeParse(filterDateSchema, value);
1515
if (!result.success) {
1616
const flattened = v.flatten(result.issues);
17-
const message = flattened.root?.[0]
18-
?? Object.values(flattened.nested ?? {})
19-
.flatMap(errors => errors ?? [])
20-
.at(0)
21-
?? 'Invalid date format';
22-
throw new TypeError(message);
17+
throw new TypeError(JSON.stringify(flattened));
2318
}
2419
return result.output;
2520
}

0 commit comments

Comments
 (0)