integer

Ensures the value is a valid integer. Also string representation of a number will return true.

integer(10) // true integer('10') // true integer('foo') // false

const rules = {
  age: 'integer'
}

// or
const rules = {
  age: [
    rule('integer')
  ]
}

For customized build, you can import this rule as follows.

import { integer } from 'indicative/builds/validations'