(
options: {
readonly minimum: number
readonly maximum: number
readonly exclusiveMinimum?: boolean | undefined
readonly exclusiveMaximum?: boolean | undefined
},
annotations?: Annotations.Filter
): SchemaAST.Filter<number>Validates that a number is within a specified range. The range boundaries can be inclusive or exclusive based on the provided options.
Details
JSON Schema:
This check corresponds to minimum/maximum or exclusiveMinimum/exclusiveMaximum
constraints in JSON Schema, depending on the options provided.
Arbitrary:
When generating test data with fast-check, this applies minimum and
maximum constraints with optional exclusiveMinimum and
exclusiveMaximum flags to ensure generated numbers fall within the
specified range.
export const const isBetween: (
options: {
readonly minimum: unknown
readonly maximum: unknown
readonly exclusiveMinimum?:
| boolean
| undefined
readonly exclusiveMaximum?:
| boolean
| undefined
},
annotations?: Annotations.Filter
) => SchemaAST.Filter<unknown>
Validates that a number is within a specified range. The range boundaries can
be inclusive or exclusive based on the provided options.
Details
JSON Schema:
This check corresponds to minimum/maximum or exclusiveMinimum/exclusiveMaximum
constraints in JSON Schema, depending on the options provided.
Arbitrary:
When generating test data with fast-check, this applies minimum and
maximum constraints with optional exclusiveMinimum and
exclusiveMaximum flags to ensure generated numbers fall within the
specified range.
isBetween = function makeIsBetween<T>(deriveOptions: {
readonly order: Order.Order<T>
readonly annotate?:
| ((options: {
readonly minimum: T
readonly maximum: T
readonly exclusiveMinimum?:
| boolean
| undefined
readonly exclusiveMaximum?:
| boolean
| undefined
}) => Annotations.Filter)
| undefined
readonly formatter?: Formatter<T> | undefined
}): (
options: {
readonly minimum: T
readonly maximum: T
readonly exclusiveMinimum?:
| boolean
| undefined
readonly exclusiveMaximum?:
| boolean
| undefined
},
annotations?: Annotations.Filter
) => SchemaAST.Filter<T>
Creates an inclusive or exclusive range check for any ordered type from an
Order.Order instance.
makeIsBetween({
order: Order.Order<number>order: import OrderOrder.Number,
annotate?: | ((options: {
readonly minimum: unknown
readonly maximum: unknown
readonly exclusiveMinimum?:
| boolean
| undefined
readonly exclusiveMaximum?:
| boolean
| undefined
}) => Annotations.Filter)
| undefined
annotate: (options: {
readonly minimum: unknown
readonly maximum: unknown
readonly exclusiveMinimum?: boolean | undefined
readonly exclusiveMaximum?: boolean | undefined
}
options) => {
return {
Annotations.Filter.meta?: Annotations.Meta | undefined(property) Annotations.Filter.meta?: {
minimum: number;
maximum: number;
exclusiveMinimum: boolean | undefined;
exclusiveMaximum: boolean | undefined;
_tag: 'isBetween';
}
Optional metadata used to identify or extend the filter with custom data.
meta: {
_tag: "isBetween"_tag: "isBetween",
...options: {
readonly minimum: unknown
readonly maximum: unknown
readonly exclusiveMinimum?: boolean | undefined
readonly exclusiveMaximum?: boolean | undefined
}
options
}
}
}
})