racoon-js
  • Introduction
  • Get Started
  • Glossary
  • API
    • number
      • int
      • min
      • max
      • enum
      • custom
      • allowNaN
      • allowInfinity
      • allowString
      • required
      • default
    • string
      • min
      • max
      • enum
      • partten
      • custom
      • required
      • default
    • boolean
      • enum
      • custom
      • required
      • default
    • object
      • custom
      • allowUnknown
      • stripUnknown
      • required
      • default
    • array
      • min
      • max
      • custom
      • required
      • default
    • any
      • enum
      • custom
      • required
      • default
  • Other Common API
    • error
    • errorForAll
    • format
    • validate
    • validateSilent
Powered by GitBook
On this page
  • Effect
  • Parameter
  • Example

Was this helpful?

  1. API

number

number()

Effect

Get a schema object of type number.

Parameter

None

Example

const schema = racoon.number();
schema.validate('abc'); // fail
schema.validate(123); // pass
PreviousGlossaryNextint

Last updated 4 years ago

Was this helpful?