Skip to content

Commit ddb8be0

Browse files
committed
deps: update abbrev@3.0.0
1 parent 538a4cc commit ddb8be0

File tree

7 files changed

+169
-15
lines changed

7 files changed

+169
-15
lines changed

node_modules/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
!/negotiator
187187
!/node-gyp
188188
!/nopt
189+
!/nopt/node_modules/
190+
/nopt/node_modules/*
191+
!/nopt/node_modules/abbrev
189192
!/normalize-package-data
190193
!/npm-audit-report
191194
!/npm-bundled

node_modules/abbrev/package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
{
22
"name": "abbrev",
3-
"version": "2.0.0",
3+
"version": "3.0.0",
44
"description": "Like ruby's abbrev module, but in js",
55
"author": "GitHub Inc.",
66
"main": "lib/index.js",
77
"scripts": {
88
"test": "tap",
9-
"lint": "eslint \"**/*.js\"",
9+
"lint": "npm run eslint",
1010
"postlint": "template-oss-check",
1111
"template-oss-apply": "template-oss-apply --force",
12-
"lintfix": "npm run lint -- --fix",
12+
"lintfix": "npm run eslint -- --fix",
1313
"snap": "tap",
14-
"posttest": "npm run lint"
14+
"posttest": "npm run lint",
15+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
1516
},
1617
"repository": {
1718
"type": "git",
18-
"url": "https://github.com/npm/abbrev-js.git"
19+
"url": "git+https://github.com/npm/abbrev-js.git"
1920
},
2021
"license": "ISC",
2122
"devDependencies": {
22-
"@npmcli/eslint-config": "^4.0.0",
23-
"@npmcli/template-oss": "4.8.0",
23+
"@npmcli/eslint-config": "^5.0.0",
24+
"@npmcli/template-oss": "4.23.3",
2425
"tap": "^16.3.0"
2526
},
2627
"tap": {
@@ -34,10 +35,11 @@
3435
"lib/"
3536
],
3637
"engines": {
37-
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
38+
"node": "^18.17.0 || >=20.5.0"
3839
},
3940
"templateOSS": {
4041
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
41-
"version": "4.8.0"
42+
"version": "4.23.3",
43+
"publish": true
4244
}
4345
}
Lines changed: 46 additions & 0 deletions
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.
Lines changed: 50 additions & 0 deletions
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+
}
Lines changed: 43 additions & 0 deletions
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+
}

package-lock.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"@npmcli/redact": "^3.0.0",
9797
"@npmcli/run-script": "^9.0.1",
9898
"@sigstore/tuf": "^2.3.4",
99-
"abbrev": "^2.0.0",
99+
"abbrev": "^3.0.0",
100100
"archy": "~1.0.0",
101101
"cacache": "^18.0.4",
102102
"chalk": "^5.3.0",
@@ -2543,13 +2543,13 @@
25432543
}
25442544
},
25452545
"node_modules/abbrev": {
2546-
"version": "2.0.0",
2547-
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz",
2548-
"integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==",
2546+
"version": "3.0.0",
2547+
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.0.tgz",
2548+
"integrity": "sha512-+/kfrslGQ7TNV2ecmQwMJj/B65g5KVq1/L3SGVZ3tCYGqlzFuFCGBZJtMP99wH3NpEUyAjn0zPdPUg0D+DwrOA==",
25492549
"inBundle": true,
25502550
"license": "ISC",
25512551
"engines": {
2552-
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
2552+
"node": "^18.17.0 || >=20.5.0"
25532553
}
25542554
},
25552555
"node_modules/acorn": {
@@ -9712,6 +9712,16 @@
97129712
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
97139713
}
97149714
},
9715+
"node_modules/nopt/node_modules/abbrev": {
9716+
"version": "2.0.0",
9717+
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz",
9718+
"integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==",
9719+
"inBundle": true,
9720+
"license": "ISC",
9721+
"engines": {
9722+
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
9723+
}
9724+
},
97159725
"node_modules/normalize-package-data": {
97169726
"version": "6.0.2",
97179727
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.2.tgz",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@npmcli/redact": "^3.0.0",
6262
"@npmcli/run-script": "^9.0.1",
6363
"@sigstore/tuf": "^2.3.4",
64-
"abbrev": "^2.0.0",
64+
"abbrev": "^3.0.0",
6565
"archy": "~1.0.0",
6666
"cacache": "^18.0.4",
6767
"chalk": "^5.3.0",

0 commit comments

Comments
 (0)