(options: {
readonly min?: Date | undefined
readonly max?: Date | undefined
readonly noInvalidDate?: boolean | undefined
})
| 185 | |
| 186 | /** @internal */ |
| 187 | export const makeDateConstraints = (options: { |
| 188 | readonly min?: Date | undefined |
| 189 | readonly max?: Date | undefined |
| 190 | readonly noInvalidDate?: boolean | undefined |
| 191 | }): DateConstraints => { |
| 192 | const out: Types.Mutable<DateConstraints> = { |
| 193 | _tag: "DateConstraints", |
| 194 | constraints: {} |
| 195 | } |
| 196 | if (Predicate.isDate(options.min)) { |
| 197 | out.constraints.min = options.min |
| 198 | } |
| 199 | if (Predicate.isDate(options.max)) { |
| 200 | out.constraints.max = options.max |
| 201 | } |
| 202 | if (Predicate.isBoolean(options.noInvalidDate)) { |
| 203 | out.constraints.noInvalidDate = options.noInvalidDate |
| 204 | } |
| 205 | return out |
| 206 | } |
| 207 | |
| 208 | type Refinements = ReadonlyArray<SchemaAST.Refinement> |
| 209 |
no outgoing calls
no test coverage detected