diff options
author | isaacs <i@izs.me> | 2013-06-18 20:31:52 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-06-18 20:32:02 +0400 |
commit | 97ada8b9e1db11e779d928d6a255e1ef4a074bee (patch) | |
tree | f99a1c13c1ff42626fa06202b41cf4d8d2c6faf5 /node_modules/npm-user-validate | |
parent | 6dcfc60c1a70ad133af7773f4b5e08f8c9c82b84 (diff) |
update npm-user-validate and normalize-package-data
Diffstat (limited to 'node_modules/npm-user-validate')
-rw-r--r-- | node_modules/npm-user-validate/.travis.yml | 4 | ||||
-rw-r--r-- | node_modules/npm-user-validate/README.md | 5 | ||||
-rw-r--r-- | node_modules/npm-user-validate/npm-user-validate.js | 26 | ||||
-rw-r--r-- | node_modules/npm-user-validate/package.json | 24 |
4 files changed, 44 insertions, 15 deletions
diff --git a/node_modules/npm-user-validate/.travis.yml b/node_modules/npm-user-validate/.travis.yml new file mode 100644 index 000000000..a12e3f0fd --- /dev/null +++ b/node_modules/npm-user-validate/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10"
\ No newline at end of file diff --git a/node_modules/npm-user-validate/README.md b/node_modules/npm-user-validate/README.md index b699863cf..5e34f0aa0 100644 --- a/node_modules/npm-user-validate/README.md +++ b/node_modules/npm-user-validate/README.md @@ -1,3 +1,6 @@ -## npmvalidate +[![Build Status](https://travis-ci.org/robertkowalski/npm-user-validate.png?branch=master)](https://travis-ci.org/robertkowalski/npm-user-validate) +[![devDependency Status](https://david-dm.org/robertkowalski/npm-user-validate/dev-status.png)](https://david-dm.org/robertkowalski/npm-user-validate#info=devDependencies) + +# npm-user-validate Validation for the npm client and npm-www (and probably other npm projects)
\ No newline at end of file diff --git a/node_modules/npm-user-validate/npm-user-validate.js b/node_modules/npm-user-validate/npm-user-validate.js index 29cb588aa..853456f52 100644 --- a/node_modules/npm-user-validate/npm-user-validate.js +++ b/node_modules/npm-user-validate/npm-user-validate.js @@ -2,17 +2,31 @@ exports.email = email exports.pw = pw exports.username = username +var requirements = exports.requirements = { + username: { + lowerCase: 'Username must be lowercase', + urlSafe: 'Username may not contain non-url-safe chars', + dot: 'Username may not start with "."' + }, + password: { + badchars: 'Password passwords cannot contain these characters: \'!:@"' + }, + email: { + valid: 'Email must be an email address' + } +}; + function username (un) { if (un !== un.toLowerCase()) { - return new Error('Username must be lowercase') + return new Error(requirements.username.lowerCase) } if (un !== encodeURIComponent(un)) { - return new Error('Username may not contain non-url-safe chars') + return new Error(requirements.username.urlSafe) } if (un.charAt(0) === '.') { - return new Error('Username may not start with "."') + return new Error(requirements.username.dot) } return null @@ -20,7 +34,7 @@ function username (un) { function email (em) { if (!em.match(/^.+@.+\..+$/)) { - return new Error('Email must be an email address') + return new Error(requirements.email.valid) } return null @@ -28,8 +42,8 @@ function email (em) { function pw (pw) { if (pw.match(/['!:@"]/)) { - return new Error('Sorry, passwords cannot contain these characters: \'!:@"') + return new Error(requirements.password.badchars) } return null -}
\ No newline at end of file +} diff --git a/node_modules/npm-user-validate/package.json b/node_modules/npm-user-validate/package.json index d2bdf7799..a05b95ef1 100644 --- a/node_modules/npm-user-validate/package.json +++ b/node_modules/npm-user-validate/package.json @@ -1,29 +1,37 @@ { "name": "npm-user-validate", - "version": "0.0.1", + "version": "0.0.3", "description": "User validations for npm", "main": "npm-user-validate.js", + "devDependencies": { + "tap": "0.4.3" + }, "scripts": { "test": "tap test/*.js" }, - "devDependencies": { - "tap": "0.4.1" - }, "repository": { "type": "git", "url": "https://github.com/robertkowalski/npm-user-validate" }, "keywords": [ "npm", - "validation" + "validation", + "registry" ], "author": { "name": "Robert Kowalski", "email": "rok@kowalski.gd" }, "license": "BSD", - "readme": "## npmvalidate\n\nValidation for the npm client and npm-www (and probably other npm projects)", + "readme": "[![Build Status](https://travis-ci.org/robertkowalski/npm-user-validate.png?branch=master)](https://travis-ci.org/robertkowalski/npm-user-validate)\n[![devDependency Status](https://david-dm.org/robertkowalski/npm-user-validate/dev-status.png)](https://david-dm.org/robertkowalski/npm-user-validate#info=devDependencies)\n\n# npm-user-validate\n\nValidation for the npm client and npm-www (and probably other npm projects)", "readmeFilename": "README.md", - "_id": "npm-user-validate@0.0.1", - "_from": "npm-user-validate@0" + "bugs": { + "url": "https://github.com/robertkowalski/npm-user-validate/issues" + }, + "_id": "npm-user-validate@0.0.3", + "dist": { + "shasum": "7b147d11038083fb0ba2d60ff851dc20322aa9f6" + }, + "_from": "npm-user-validate@0.0.3", + "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.0.3.tgz" } |