【文件属性】:
文件名称:matches:验证值是否与指定的一组值中的任何一个匹配
文件大小:8KB
文件格式:ZIP
更新时间:2021-06-23 16:44:44
JavaScript
火柴
验证值是否与一组指定值中的任何一个匹配。
安装
$ npm install validate.io-matches
要在浏览器中使用,请使用 。
用法
var matches = require ( 'validate.io-matches' ) ;
匹配(值,选项)
验证值是否与一组指定值中的任何一个匹配。
var value = 'c' ,
options = 'a,b,c,d,e' ;
var bool = matches ( value , options ) ;
// returns true
笔记
此方法仅适用于string和number值类型。 对于任何其他类型,该方法返回false 。
numeric被转换为strings 。
可接受的matches列表应序列化为逗号分隔的string 。
例子
console . log ( matches (
【文件预览】:
matches-master
----.travis.yml(73B)
----.jshintignore(118B)
----package.json(1KB)
----test()
--------test.js(1KB)
----LICENSE(1KB)
----TODO.md(12B)
----.npmignore(498B)
----examples()
--------index.js(273B)
----.gitignore(711B)
----lib()
--------index.js(1KB)
----Makefile(2KB)
----README.md(3KB)
----.jshintrc(1KB)
----.editorconfig(169B)
----.gitattributes(12B)