Hyperlinkv0.8.0-beta.28

Schema

Schema.isMultipleOfconsteffect/Schema.ts:7485
(
  divisor: number,
  annotations?: Annotations.Filter
): SchemaAST.Filter<number>

Validates that a number is a multiple of the specified divisor.

Details

JSON Schema:

This check corresponds to the multipleOf constraint in JSON Schema.

Arbitrary:

When generating test data with fast-check, this applies constraints to ensure generated numbers are multiples of the specified divisor.

Number checks
Source effect/Schema.ts:748511 lines
export const isMultipleOf = makeIsMultipleOf({
  remainder,
  zero: 0,
  annotate: (divisor) => ({
    expected: `a value that is a multiple of ${divisor}`,
    meta: {
      _tag: "isMultipleOf",
      divisor
    }
  })
})
Referenced by 1 symbols