The options for an Integer:

  • round?: 'floor' | 'ceil' | 'round' | 'deny' - how should the number be rounded
  • min?: number - minimum allowed number
  • max?: number - maximum allowed number

Hierarchy

Properties

Properties

max?: number

the upper bound of the interval the value has to be in

min?: number

the lower bound of the interval the value has to be in

name?: string

the name of the ValueObject to identify in a possible ErrorMessage.

  • eg: 'MealPlan.price'
round?: "round" | "floor" | "ceil" | "deny"

how should the number be rounded.

  • defaults to 'deny' which causes the validate() method to throw an error if the number has decimal places.

Generated using TypeDoc