update
This commit is contained in:
27
package/node_modules/npm-user-validate/LICENSE
generated
vendored
Normal file
27
package/node_modules/npm-user-validate/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) Robert Kowalski
|
||||
All rights reserved.
|
||||
|
||||
The BSD License
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
61
package/node_modules/npm-user-validate/lib/index.js
generated
vendored
Normal file
61
package/node_modules/npm-user-validate/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
exports.email = email
|
||||
exports.pw = pw
|
||||
exports.username = username
|
||||
var requirements = exports.requirements = {
|
||||
username: {
|
||||
length: 'Name length must be less than or equal to 214 characters long',
|
||||
lowerCase: 'Name must be lowercase',
|
||||
urlSafe: 'Name may not contain non-url-safe chars',
|
||||
dot: 'Name may not start with "."',
|
||||
illegal: 'Name may not contain illegal character',
|
||||
},
|
||||
password: {},
|
||||
email: {
|
||||
length: 'Email length must be less then or equal to 254 characters long',
|
||||
valid: 'Email must be an email address',
|
||||
},
|
||||
}
|
||||
|
||||
var illegalCharacterRe = new RegExp('([' + [
|
||||
"'",
|
||||
].join() + '])')
|
||||
|
||||
function username (un) {
|
||||
if (un !== un.toLowerCase()) {
|
||||
return new Error(requirements.username.lowerCase)
|
||||
}
|
||||
|
||||
if (un !== encodeURIComponent(un)) {
|
||||
return new Error(requirements.username.urlSafe)
|
||||
}
|
||||
|
||||
if (un.charAt(0) === '.') {
|
||||
return new Error(requirements.username.dot)
|
||||
}
|
||||
|
||||
if (un.length > 214) {
|
||||
return new Error(requirements.username.length)
|
||||
}
|
||||
|
||||
var illegal = un.match(illegalCharacterRe)
|
||||
if (illegal) {
|
||||
return new Error(requirements.username.illegal + ' "' + illegal[0] + '"')
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function email (em) {
|
||||
if (em.length > 254) {
|
||||
return new Error(requirements.email.length)
|
||||
}
|
||||
if (!em.match(/^[^@]+@.+\..+$/)) {
|
||||
return new Error(requirements.email.valid)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function pw () {
|
||||
return null
|
||||
}
|
49
package/node_modules/npm-user-validate/package.json
generated
vendored
Normal file
49
package/node_modules/npm-user-validate/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "npm-user-validate",
|
||||
"version": "2.0.1",
|
||||
"description": "User validations for npm",
|
||||
"main": "lib/index.js",
|
||||
"devDependencies": {
|
||||
"@npmcli/eslint-config": "^4.0.1",
|
||||
"@npmcli/template-oss": "4.22.0",
|
||||
"tap": "^16.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap",
|
||||
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
|
||||
"postlint": "template-oss-check",
|
||||
"template-oss-apply": "template-oss-apply --force",
|
||||
"lintfix": "npm run lint -- --fix",
|
||||
"snap": "tap",
|
||||
"posttest": "npm run lint"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/npm-user-validate.git"
|
||||
},
|
||||
"keywords": [
|
||||
"npm",
|
||||
"validation",
|
||||
"registry"
|
||||
],
|
||||
"author": "GitHub Inc.",
|
||||
"license": "BSD-2-Clause",
|
||||
"files": [
|
||||
"bin/",
|
||||
"lib/"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
},
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"version": "4.22.0",
|
||||
"publish": true
|
||||
},
|
||||
"tap": {
|
||||
"nyc-arg": [
|
||||
"--exclude",
|
||||
"tap-snapshots/**"
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user