Skip to content

Commit d9f5133

Browse files
committed
🐞 fix: use derived type in date transformer
1 parent a0a1698 commit d9f5133

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/generators/transformDate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { getConfig } from "../config";
22

33
export function transformDateType() {
4-
return `import { type StringOptions, ${getConfig().typeboxImportVariableName} } from "${getConfig().typeboxImportDependencyName}";
5-
export const ${getConfig().transformDateName} = (options?: StringOptions) => ${
4+
return `import { ${getConfig().typeboxImportVariableName} } from "${getConfig().typeboxImportDependencyName}";
5+
export const ${getConfig().transformDateName} = (options?: Parameters<typeof ${getConfig().typeboxImportVariableName}.String>[0]) => ${
66
getConfig().typeboxImportVariableName
77
}.Transform(${getConfig().typeboxImportVariableName}.String({ format: 'date-time', ...options }))
88
.Decode((value) => new Date(value))

0 commit comments

Comments
 (0)