Skip to content

Commit 105fa2b

Browse files
committedOct 2, 2024
deps: update nopt@8.0.0
1 parent eae4f57 commit 105fa2b

File tree

16 files changed

+886
-18
lines changed

16 files changed

+886
-18
lines changed
 

‎node_modules/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@
221221
/node-gyp/node_modules/@npmcli/*
222222
!/node-gyp/node_modules/@npmcli/agent
223223
!/node-gyp/node_modules/@npmcli/fs
224+
!/node-gyp/node_modules/abbrev
224225
!/node-gyp/node_modules/cacache
225226
!/node-gyp/node_modules/make-fetch-happen
227+
!/node-gyp/node_modules/nopt
226228
!/node-gyp/node_modules/unique-filename
227229
!/node-gyp/node_modules/unique-slug
228230
!/nopt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
This software is dual-licensed under the ISC and MIT licenses.
2+
You may use this software under EITHER of the following licenses.
3+
4+
----------
5+
6+
The ISC License
7+
8+
Copyright (c) Isaac Z. Schlueter and Contributors
9+
10+
Permission to use, copy, modify, and/or distribute this software for any
11+
purpose with or without fee is hereby granted, provided that the above
12+
copyright notice and this permission notice appear in all copies.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
20+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21+
22+
----------
23+
24+
Copyright Isaac Z. Schlueter and Contributors
25+
All rights reserved.
26+
27+
Permission is hereby granted, free of charge, to any person
28+
obtaining a copy of this software and associated documentation
29+
files (the "Software"), to deal in the Software without
30+
restriction, including without limitation the rights to use,
31+
copy, modify, merge, publish, distribute, sublicense, and/or sell
32+
copies of the Software, and to permit persons to whom the
33+
Software is furnished to do so, subject to the following
34+
conditions:
35+
36+
The above copyright notice and this permission notice shall be
37+
included in all copies or substantial portions of the Software.
38+
39+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
40+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
41+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
42+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
43+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
44+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
45+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46+
OTHER DEALINGS IN THE SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = abbrev
2+
3+
function abbrev (...args) {
4+
let list = args.length === 1 || Array.isArray(args[0]) ? args[0] : args
5+
6+
for (let i = 0, l = list.length; i < l; i++) {
7+
list[i] = typeof list[i] === 'string' ? list[i] : String(list[i])
8+
}
9+
10+
// sort them lexicographically, so that they're next to their nearest kin
11+
list = list.sort(lexSort)
12+
13+
// walk through each, seeing how much it has in common with the next and previous
14+
const abbrevs = {}
15+
let prev = ''
16+
for (let ii = 0, ll = list.length; ii < ll; ii++) {
17+
const current = list[ii]
18+
const next = list[ii + 1] || ''
19+
let nextMatches = true
20+
let prevMatches = true
21+
if (current === next) {
22+
continue
23+
}
24+
let j = 0
25+
const cl = current.length
26+
for (; j < cl; j++) {
27+
const curChar = current.charAt(j)
28+
nextMatches = nextMatches && curChar === next.charAt(j)
29+
prevMatches = prevMatches && curChar === prev.charAt(j)
30+
if (!nextMatches && !prevMatches) {
31+
j++
32+
break
33+
}
34+
}
35+
prev = current
36+
if (j === cl) {
37+
abbrevs[current] = current
38+
continue
39+
}
40+
for (let a = current.slice(0, j); j <= cl; j++) {
41+
abbrevs[a] = current
42+
a += current.charAt(j)
43+
}
44+
}
45+
return abbrevs
46+
}
47+
48+
function lexSort (a, b) {
49+
return a === b ? 0 : a > b ? 1 : -1
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "abbrev",
3+
"version": "2.0.0",
4+
"description": "Like ruby's abbrev module, but in js",
5+
"author": "GitHub Inc.",
6+
"main": "lib/index.js",
7+
"scripts": {
8+
"test": "tap",
9+
"lint": "eslint \"**/*.js\"",
10+
"postlint": "template-oss-check",
11+
"template-oss-apply": "template-oss-apply --force",
12+
"lintfix": "npm run lint -- --fix",
13+
"snap": "tap",
14+
"posttest": "npm run lint"
15+
},
16+
"repository": {
17+
"type": "git",
18+
"url": "https://github.com/npm/abbrev-js.git"
19+
},
20+
"license": "ISC",
21+
"devDependencies": {
22+
"@npmcli/eslint-config": "^4.0.0",
23+
"@npmcli/template-oss": "4.8.0",
24+
"tap": "^16.3.0"
25+
},
26+
"tap": {
27+
"nyc-arg": [
28+
"--exclude",
29+
"tap-snapshots/**"
30+
]
31+
},
32+
"files": [
33+
"bin/",
34+
"lib/"
35+
],
36+
"engines": {
37+
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
38+
},
39+
"templateOSS": {
40+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
41+
"version": "4.8.0"
42+
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The ISC License
2+
3+
Copyright (c) Isaac Z. Schlueter and Contributors
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env node
2+
const nopt = require('../lib/nopt')
3+
const path = require('path')
4+
console.log('parsed', nopt({
5+
num: Number,
6+
bool: Boolean,
7+
help: Boolean,
8+
list: Array,
9+
'num-list': [Number, Array],
10+
'str-list': [String, Array],
11+
'bool-list': [Boolean, Array],
12+
str: String,
13+
clear: Boolean,
14+
config: Boolean,
15+
length: Number,
16+
file: path,
17+
}, {
18+
s: ['--str', 'astring'],
19+
b: ['--bool'],
20+
nb: ['--no-bool'],
21+
tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'],
22+
'?': ['--help'],
23+
h: ['--help'],
24+
H: ['--help'],
25+
n: ['--num', '125'],
26+
c: ['--config'],
27+
l: ['--length'],
28+
f: ['--file'],
29+
}, process.argv, 2))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* istanbul ignore next */
2+
module.exports = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
3+
// eslint-disable-next-line no-console
4+
? (...a) => console.error(...a)
5+
: () => {}

‎node_modules/node-gyp/node_modules/nopt/lib/nopt-lib.js

+479
Large diffs are not rendered by default.

‎node_modules/node-gyp/node_modules/nopt/lib/nopt.js

+30
Original file line numberDiff line numberDiff line change

‎node_modules/node-gyp/node_modules/nopt/lib/type-defs.js

+91
Original file line numberDiff line numberDiff line change

‎node_modules/node-gyp/node_modules/nopt/package.json

+51
Original file line numberDiff line numberDiff line change

‎node_modules/nopt/package.json

+9-8
Original file line numberDiff line numberDiff line change

‎package-lock.json

+33-7
Original file line numberDiff line numberDiff line change

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"minipass-pipeline": "^1.2.4",
9494
"ms": "^2.1.2",
9595
"node-gyp": "^10.2.0",
96-
"nopt": "^7.2.1",
96+
"nopt": "^8.0.0",
9797
"normalize-package-data": "^6.0.2",
9898
"npm-audit-report": "^5.0.0",
9999
"npm-install-checks": "^6.3.0",

‎workspaces/arborist/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"json-stringify-nice": "^1.1.4",
2323
"lru-cache": "^10.2.2",
2424
"minimatch": "^9.0.4",
25-
"nopt": "^7.2.1",
25+
"nopt": "^8.0.0",
2626
"npm-install-checks": "^6.2.0",
2727
"npm-package-arg": "^11.0.2",
2828
"npm-pick-manifest": "^9.0.1",

‎workspaces/config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@npmcli/package-json": "^6.0.1",
4242
"ci-info": "^4.0.0",
4343
"ini": "^5.0.0",
44-
"nopt": "^7.2.1",
44+
"nopt": "^8.0.0",
4545
"proc-log": "^4.2.0",
4646
"semver": "^7.3.5",
4747
"walk-up-path": "^3.0.1"

0 commit comments

Comments
 (0)
Please sign in to comment.