Skip to content

Commit 028a899

Browse files
authored
Fix: Added missing format property in StringSchema (#356)
1 parent 7f80f98 commit 028a899

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ declare namespace build {
6464

6565
export interface StringSchema extends BaseSchema {
6666
type: "string";
67+
format?: string;
6768
}
6869

6970
export interface IntegerSchema extends BaseSchema {

test/types/test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,11 @@ const schema11: Schema = {
135135
}
136136

137137
build(schema11)({ something: 'a string', somethingElse: 42 })
138+
139+
// String schema with format
140+
const schema12: Schema = {
141+
type: 'string',
142+
format: 'date-time'
143+
}
144+
145+
build(schema12)(new Date())

0 commit comments

Comments
 (0)