validate-props

0.0.5 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i validate-props

Weekly Downloads

2

Version

0.0.5

License

ISC

Last publish

Collaborators

  • twobin