racoon-js
  • Introduction
  • 快速上手
  • 名词解释
  • 接口说明
    • number
      • int
      • min
      • max
      • enum
      • custom
      • allowNaN
      • allowInfinity
      • allowString
      • required
      • default
    • string
      • min
      • max
      • enum
      • pattern
      • custom
      • required
      • default
    • boolean
      • enum
      • custom
      • required
      • default
    • object
      • custom
      • allowUnknown
      • stripUnkown
      • required
      • default
    • array
      • min
      • max
      • custom
      • required
      • default
    • any
      • enum
      • custom
      • required
      • default
  • 其它通用接口
    • error
    • errorForAll
    • format
    • validate
    • validateSilent
由 GitBook 提供支持
在本页
  • 作用
  • 参数
  • 示例

这有帮助吗?

  1. 接口说明

number

number()

作用

获取number类型schema对象。

参数

无

示例

const schema = racoon.number();
schema.validate('abc'); // fail
schema.validate(123); // pass
上一页名词解释下一页int

最后更新于4年前

这有帮助吗?