Skip to content

Commit 570291f

Browse files
committed
simplify parseContextThreshold
1 parent 71515f6 commit 570291f

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ import { CostModes, filterDateSchema, SortOrders } from './_types.ts';
88
* Parses and validates a date argument in YYYYMMDD format
99
* @param value - Date string to parse
1010
* @returns Validated date string
11-
* @throws TypeError if date format is invalid
1211
*/
1312
function parseDateArg(value: string): string {
14-
const result = v.safeParse(filterDateSchema, value);
15-
if (!result.success) {
16-
const flattened = v.flatten(result.issues);
17-
throw new TypeError(JSON.stringify(flattened));
18-
}
19-
return result.output;
13+
return v.parse(filterDateSchema, value);
2014
}
2115

2216
/**

0 commit comments

Comments
 (0)