@jdfed/drip-form-plugin-formats
TypeScript icon, indicating that this package has built-in type declarations

0.8.2 • Public • Published

@jdfed/drip-form-plugin-formats

drip-form 官方formats插件,目前有date-time、color

date-time: /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)$/i正则校验。例子:2020-09-17 12:00:00

color: 校验rgba、rgb、hex三种格式颜色 例子:rgba(0,0,0,1)、rgba(0,0,0)、#000000

Usage

const addFormats = require('@jdfed/drip-form-plugin-default');
cont Ajv = require('ajv')
const ajv = new Ajv()

//添加所有formats
addFormats(ajv) 
//添加指定formats
addFormats(ajv,['color'])

Readme

Keywords

Package Sidebar

Install

npm i @jdfed/drip-form-plugin-formats

Weekly Downloads

14

Version

0.8.2

License

MIT

Unpacked Size

19.5 kB

Total Files

10

Last publish

Collaborators

  • qishaoxuan
  • helloqian12138
  • tinymins
  • crazywood007
  • mengshang918