twobin / validate-props

validate customize meta props

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

validate-props

validate props

npm version build status npm downloads

usage

$ npm i -S validate-props

docs

validate-props

import validateProps from 'validate-props';

validateProps(value, type);

type

  • string

  • number

  • bool

  • array

  • object

  • func

  • func({value: string, data: array}) // 指定函数回调格式

  • oneOfString(['detail', 'summary'])

  • oneOfNumber([10, 100])

  • oneOfType([string, array, number])

  • arrayOf(number) // number, string, bool

  • shape({ value: number, text: string }) // 输入的格式

  • urls // 预定义的一种类型,专门用于配置取数 url

About

validate customize meta props


Languages

Language:JavaScript 100.0%