MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeDateConstraints

Function makeDateConstraints

packages/effect/src/Arbitrary.ts:187–206  ·  view source on GitHub ↗
(options: {
  readonly min?: Date | undefined
  readonly max?: Date | undefined
  readonly noInvalidDate?: boolean | undefined
})

Source from the content-addressed store, hash-verified

185
186/** @internal */
187export 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
208type Refinements = ReadonlyArray<SchemaAST.Refinement>
209

Callers 2

Arbitrary.tsFile · 0.85
mergeDateConstraintsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected