Comparing version 2.1.0 to 2.2.0
16
index.js
@@ -1,10 +0,1 @@ | ||
/** | ||
* Copyright(c) node-modules and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <fengmk2@gmail.com> | ||
* dead_horse <dead_horse@qq.com> | ||
*/ | ||
'use strict'; | ||
@@ -473,2 +464,9 @@ | ||
if (rule.hasOwnProperty('max') && value.length > rule.max) { | ||
return this.t('length should smaller than %s', rule.max); | ||
} | ||
if (rule.hasOwnProperty('min') && value.length < rule.min) { | ||
return this.t('length should bigger than %s', rule.min); | ||
} | ||
if (!rule.itemType) { | ||
@@ -475,0 +473,0 @@ return; |
This software is licensed under the MIT License. | ||
Copyright(c) 2013 - 2015 by node-modules and other contributors. | ||
Copyright(c) 2013 - 2017 node-modules and other contributors. | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "parameter", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "A parameter verify tools.", | ||
@@ -10,6 +10,10 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "mocha --check-leaks -R spec -t 1000 test/*.test.js", | ||
"test-cov": "istanbul cover node_modules/.bin/_mocha -- --check-leaks -t 1000 test/*.test.js" | ||
"test": "mocha -R spec -t 1000 test/*.test.js", | ||
"cov": "istanbul cover _mocha -- -t 1000 test/*.test.js", | ||
"ci": "npm run cov", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"npminstall": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
@@ -20,7 +24,8 @@ "beautify-benchmark": "0", | ||
"mocha": "*", | ||
"should": "*" | ||
"should": "*", | ||
"semantic-release": "^6.3.6" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/node-modules/parameter.git" | ||
"url": "https://github.com/node-modules/parameter.git" | ||
}, | ||
@@ -33,6 +38,6 @@ "keywords": [ | ||
"engines": { | ||
"node": ">= 2.0.0" | ||
"node": ">= 4.0.0" | ||
}, | ||
"author": "fengmk2 <fengmk2@gmail.com>", | ||
"license": "MIT" | ||
} | ||
} |
@@ -8,2 +8,3 @@ parameter | ||
[![npm download][download-image]][download-url] | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) | ||
@@ -160,6 +161,8 @@ [npm-image]: https://img.shields.io/npm/v/parameter.svg?style=flat-square | ||
If type is `array`, there has tow addition rule: | ||
If type is `array`, there has four addition rule: | ||
- `itemType` - The type of every item in this array. | ||
- `rule` - An object that validate the items of the array. Only work with `itemType`. | ||
- `max` - The maximun length of the array. | ||
- `min` - The minimun lenght of the array. | ||
@@ -166,0 +169,0 @@ #### abbr |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19725
210
0
1
6
441
+ Addednpminstall@^3.0.1
+ Addedabbrev@1.1.1(transitive)
+ Addedagentkeepalive@3.5.3(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedany-promise@1.3.0(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedawait-event@2.1.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbinary-mirror-config@1.41.0(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbytes@2.5.0(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedchownr@1.1.4(transitive)
+ Addedcli-cursor@2.1.0(transitive)
+ Addedcli-spinners@1.3.1(transitive)
+ Addedcmd-shim-hotfix@3.0.3(transitive)
+ Addedco@4.6.0(transitive)
+ Addedco-from-stream@0.0.0(transitive)
+ Addedco-fs-extra@1.2.1(transitive)
+ Addedco-parallel@1.0.0(transitive)
+ Addedco-read@0.0.1(transitive)
+ Addedco-thread@0.0.1(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcopy-to@2.0.1(transitive)
+ Addedcore-util-is@1.0.21.0.3(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddefault-user-agent@1.0.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addeddigest-header@1.1.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedenable@1.3.2(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedenv-paths@2.2.1(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextend-shallow@2.0.1(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedformstream@1.5.1(transitive)
+ Addedfs-extra@0.26.7(transitive)
+ Addedfs-minipass@1.2.7(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedhumanize-ms@1.2.1(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-class-hotfix@0.0.6(transitive)
+ Addedis-core-module@2.16.1(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedis-type-of@1.4.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsonfile@2.4.0(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedklaw@1.3.1(transitive)
+ Addedko-sleep@1.1.4(transitive)
+ Addedlog-symbols@1.0.2(transitive)
+ Addedmime@2.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmimic-fn@1.2.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedminipass@2.9.0(transitive)
+ Addedminizlib@1.3.3(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedms@2.0.02.1.3(transitive)
+ Addedmz@2.7.0(transitive)
+ Addedmz-modules@2.1.0(transitive)
+ Addednode-gyp@6.1.0(transitive)
+ Addednode-hex@1.0.1(transitive)
+ Addednode-homedir@1.1.1(transitive)
+ Addednopt@4.0.3(transitive)
+ Addednormalize-git-url@3.0.2(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addednpm-normalize-package-bin@1.0.1(transitive)
+ Addednpm-package-arg@4.2.1(transitive)
+ Addednpminstall@3.28.1(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedonetime@2.0.1(transitive)
+ Addedora@1.3.0(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-name@1.0.3(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedosenv@0.1.5(transitive)
+ Addedosx-release@1.1.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpause-stream@0.0.11(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedresolve@1.22.10(transitive)
+ Addedrestore-cursor@2.0.0(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedrunscript@1.6.0(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.21(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstatuses@1.5.0(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtar@4.4.19(transitive)
+ Addedthenify@3.3.1(transitive)
+ Addedthenify-all@1.6.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedthunkify-wrap@1.0.4(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedunescape@1.0.1(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedurllib@2.44.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedutility@1.18.0(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwin-release@1.1.1(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyallist@3.1.1(transitive)