Skip to content

Commit

Permalink
deps: update nopt@8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
reggi committed Oct 2, 2024
1 parent eae4f57 commit 105fa2b
Show file tree
Hide file tree
Showing 16 changed files with 886 additions and 18 deletions.
2 changes: 2 additions & 0 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@
/node-gyp/node_modules/@npmcli/*
!/node-gyp/node_modules/@npmcli/agent
!/node-gyp/node_modules/@npmcli/fs
!/node-gyp/node_modules/abbrev
!/node-gyp/node_modules/cacache
!/node-gyp/node_modules/make-fetch-happen
!/node-gyp/node_modules/nopt
!/node-gyp/node_modules/unique-filename
!/node-gyp/node_modules/unique-slug
!/nopt
Expand Down
46 changes: 46 additions & 0 deletions node_modules/node-gyp/node_modules/abbrev/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
This software is dual-licensed under the ISC and MIT licenses.
You may use this software under EITHER of the following licenses.

----------

The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

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.

----------

Copyright Isaac Z. Schlueter and Contributors
All rights reserved.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
50 changes: 50 additions & 0 deletions node_modules/node-gyp/node_modules/abbrev/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
module.exports = abbrev

function abbrev (...args) {
let list = args.length === 1 || Array.isArray(args[0]) ? args[0] : args

for (let i = 0, l = list.length; i < l; i++) {
list[i] = typeof list[i] === 'string' ? list[i] : String(list[i])
}

// sort them lexicographically, so that they're next to their nearest kin
list = list.sort(lexSort)

// walk through each, seeing how much it has in common with the next and previous
const abbrevs = {}
let prev = ''
for (let ii = 0, ll = list.length; ii < ll; ii++) {
const current = list[ii]
const next = list[ii + 1] || ''
let nextMatches = true
let prevMatches = true
if (current === next) {
continue
}
let j = 0
const cl = current.length
for (; j < cl; j++) {
const curChar = current.charAt(j)
nextMatches = nextMatches && curChar === next.charAt(j)
prevMatches = prevMatches && curChar === prev.charAt(j)
if (!nextMatches && !prevMatches) {
j++
break
}
}
prev = current
if (j === cl) {
abbrevs[current] = current
continue
}
for (let a = current.slice(0, j); j <= cl; j++) {
abbrevs[a] = current
a += current.charAt(j)
}
}
return abbrevs
}

function lexSort (a, b) {
return a === b ? 0 : a > b ? 1 : -1
}
43 changes: 43 additions & 0 deletions node_modules/node-gyp/node_modules/abbrev/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "abbrev",
"version": "2.0.0",
"description": "Like ruby's abbrev module, but in js",
"author": "GitHub Inc.",
"main": "lib/index.js",
"scripts": {
"test": "tap",
"lint": "eslint \"**/*.js\"",
"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": "https://github.com/npm/abbrev-js.git"
},
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.8.0",
"tap": "^16.3.0"
},
"tap": {
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
},
"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.8.0"
}
}
15 changes: 15 additions & 0 deletions node_modules/node-gyp/node_modules/nopt/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

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.
29 changes: 29 additions & 0 deletions node_modules/node-gyp/node_modules/nopt/bin/nopt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env node
const nopt = require('../lib/nopt')
const path = require('path')
console.log('parsed', nopt({
num: Number,
bool: Boolean,
help: Boolean,
list: Array,
'num-list': [Number, Array],
'str-list': [String, Array],
'bool-list': [Boolean, Array],
str: String,
clear: Boolean,
config: Boolean,
length: Number,
file: path,
}, {
s: ['--str', 'astring'],
b: ['--bool'],
nb: ['--no-bool'],
tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'],
'?': ['--help'],
h: ['--help'],
H: ['--help'],
n: ['--num', '125'],
c: ['--config'],
l: ['--length'],
f: ['--file'],
}, process.argv, 2))
5 changes: 5 additions & 0 deletions node_modules/node-gyp/node_modules/nopt/lib/debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* istanbul ignore next */
module.exports = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
// eslint-disable-next-line no-console
? (...a) => console.error(...a)
: () => {}
Loading

0 comments on commit 105fa2b

Please sign in to comment.