Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
15
my-app/node_modules/npm-normalize-package-bin/LICENSE
generated
vendored
Executable file
15
my-app/node_modules/npm-normalize-package-bin/LICENSE
generated
vendored
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
The ISC License
|
||||
|
||||
Copyright (c) npm, Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
14
my-app/node_modules/npm-normalize-package-bin/README.md
generated
vendored
Executable file
14
my-app/node_modules/npm-normalize-package-bin/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
# npm-normalize-package-bin
|
||||
|
||||
Turn any flavor of allowable package.json bin into a normalized object.
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
const normalize = require('npm-normalize-package-bin')
|
||||
const pkg = {name: 'foo', bin: 'bar'}
|
||||
console.log(normalize(pkg)) // {name:'foo', bin:{foo: 'bar'}}
|
||||
```
|
||||
|
||||
Also strips out weird dots and slashes to prevent accidental and/or
|
||||
malicious bad behavior when the package is installed.
|
||||
64
my-app/node_modules/npm-normalize-package-bin/lib/index.js
generated
vendored
Executable file
64
my-app/node_modules/npm-normalize-package-bin/lib/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
// pass in a manifest with a 'bin' field here, and it'll turn it
|
||||
// into a properly santized bin object
|
||||
const { join, basename } = require('path')
|
||||
|
||||
const normalize = pkg =>
|
||||
!pkg.bin ? removeBin(pkg)
|
||||
: typeof pkg.bin === 'string' ? normalizeString(pkg)
|
||||
: Array.isArray(pkg.bin) ? normalizeArray(pkg)
|
||||
: typeof pkg.bin === 'object' ? normalizeObject(pkg)
|
||||
: removeBin(pkg)
|
||||
|
||||
const normalizeString = pkg => {
|
||||
if (!pkg.name) {
|
||||
return removeBin(pkg)
|
||||
}
|
||||
pkg.bin = { [pkg.name]: pkg.bin }
|
||||
return normalizeObject(pkg)
|
||||
}
|
||||
|
||||
const normalizeArray = pkg => {
|
||||
pkg.bin = pkg.bin.reduce((acc, k) => {
|
||||
acc[basename(k)] = k
|
||||
return acc
|
||||
}, {})
|
||||
return normalizeObject(pkg)
|
||||
}
|
||||
|
||||
const removeBin = pkg => {
|
||||
delete pkg.bin
|
||||
return pkg
|
||||
}
|
||||
|
||||
const normalizeObject = pkg => {
|
||||
const orig = pkg.bin
|
||||
const clean = {}
|
||||
let hasBins = false
|
||||
Object.keys(orig).forEach(binKey => {
|
||||
const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1)
|
||||
|
||||
if (typeof orig[binKey] !== 'string' || !base) {
|
||||
return
|
||||
}
|
||||
|
||||
const binTarget = join('/', orig[binKey].replace(/\\/g, '/'))
|
||||
.replace(/\\/g, '/').slice(1)
|
||||
|
||||
if (!binTarget) {
|
||||
return
|
||||
}
|
||||
|
||||
clean[base] = binTarget
|
||||
hasBins = true
|
||||
})
|
||||
|
||||
if (hasBins) {
|
||||
pkg.bin = clean
|
||||
} else {
|
||||
delete pkg.bin
|
||||
}
|
||||
|
||||
return pkg
|
||||
}
|
||||
|
||||
module.exports = normalize
|
||||
44
my-app/node_modules/npm-normalize-package-bin/package.json
generated
vendored
Executable file
44
my-app/node_modules/npm-normalize-package-bin/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"name": "npm-normalize-package-bin",
|
||||
"version": "3.0.1",
|
||||
"description": "Turn any flavor of allowable package.json bin into a normalized object",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/npm/npm-normalize-package-bin.git"
|
||||
},
|
||||
"author": "GitHub Inc.",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"lint": "eslint \"**/*.js\"",
|
||||
"postlint": "template-oss-check",
|
||||
"template-oss-apply": "template-oss-apply --force",
|
||||
"lintfix": "npm run lint -- --fix",
|
||||
"posttest": "npm run lint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/eslint-config": "^4.0.0",
|
||||
"@npmcli/template-oss": "4.14.1",
|
||||
"tap": "^16.3.0"
|
||||
},
|
||||
"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.14.1",
|
||||
"publish": "true"
|
||||
},
|
||||
"tap": {
|
||||
"nyc-arg": [
|
||||
"--exclude",
|
||||
"tap-snapshots/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue