Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions node_modules/bin-links/lib/check-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// either rejects or resolves to nothing. return value not relevant.
const isWindows = require('./is-windows.js')
const binTarget = require('./bin-target.js')
const { resolve, dirname } = require('path')
const { resolve, dirname, sep } = require('path')
const readCmdShim = require('read-cmd-shim')
const { readlink } = require('fs/promises')

Expand Down Expand Up @@ -34,7 +34,9 @@ const checkLink = async ({ target, path }) => {

const resolved = resolve(dirname(target), current)

if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) {
const resolvedLower = resolved.toLowerCase()
const pathLower = path.toLowerCase()
if (resolvedLower !== pathLower && !resolvedLower.startsWith(pathLower + sep)) {
return failEEXIST({ target })
}
}
Expand Down Expand Up @@ -65,7 +67,9 @@ const checkShim = async ({ target, path }) => {

const resolved = resolve(dirname(shim), current.replace(/\\/g, '/'))

if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) {
const resolvedLower = resolved.toLowerCase()
const pathLower = path.toLowerCase()
if (resolvedLower !== pathLower && !resolvedLower.startsWith(pathLower + sep)) {
return failEEXIST({ target: shim })
}
}))
Expand Down
4 changes: 2 additions & 2 deletions node_modules/bin-links/lib/link-gently.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// if there's a symlink already, pointing into our pkg, remove it first
// then create the symlink

const { resolve, dirname } = require('path')
const { resolve, dirname, sep } = require('path')
const { lstat, mkdir, readlink, rm, symlink } = require('fs/promises')
const { log } = require('proc-log')
const throwSignificant = er => {
Expand Down Expand Up @@ -63,7 +63,7 @@ const linkGently = async ({ path, to, from, absFrom, force }) => {
} // skip it, already set up like we want it.

target = resolve(dirname(to), target)
if (target.indexOf(path) === 0 || force) {
if (target === path || target.startsWith(path + sep) || force) {
return rm(to, rmOpts).then(() => CLOBBER)
}
// neither skip nor clobber
Expand Down
5 changes: 3 additions & 2 deletions node_modules/bin-links/lib/shim-bin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { resolve, dirname } = require('path')
const { resolve, dirname, sep } = require('path')
const { lstat } = require('fs/promises')
const throwNonEnoent = er => {
if (er.code !== 'ENOENT') {
Expand Down Expand Up @@ -64,7 +64,8 @@ const shimBin = ({ path, to, from, absFrom, force }) => {
return readCmdShim(s)
.then(target => {
target = resolve(dirname(to), target)
if (target.indexOf(resolve(path)) !== 0) {
const base = resolve(path)
if (target !== base && !target.startsWith(base + sep)) {
return failEEXIST({ from, to, path })
}
return false
Expand Down
10 changes: 6 additions & 4 deletions node_modules/bin-links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bin-links",
"version": "6.0.0",
"version": "6.0.2",
"description": "JavaScript package binary linker",
"main": "./lib/index.js",
"scripts": {
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.27.1",
"@npmcli/template-oss": "4.30.0",
"require-inject": "^1.4.4",
"tap": "^16.0.1"
},
Expand All @@ -55,7 +55,9 @@
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "4.27.1",
"publish": true
"version": "4.30.0",
"publish": true,
"updateNpm": false,
"latestCiVersion": 24
}
}
2 changes: 1 addition & 1 deletion node_modules/brace-expansion/dist/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function expand_(str, max, isTop) {
}
const pad = n.some(isPadded);
N = [];
for (let i = x; test(i, y); i += incr) {
for (let i = x; test(i, y) && N.length < max; i += incr) {
let c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
Expand Down
2 changes: 1 addition & 1 deletion node_modules/brace-expansion/dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function expand_(str, max, isTop) {
}
const pad = n.some(isPadded);
N = [];
for (let i = x; test(i, y); i += incr) {
for (let i = x; test(i, y) && N.length < max; i += incr) {
let c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
Expand Down
2 changes: 1 addition & 1 deletion node_modules/brace-expansion/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "brace-expansion",
"description": "Brace expansion as known from sh/bash",
"version": "5.0.5",
"version": "5.0.6",
"files": [
"dist"
],
Expand Down
4 changes: 2 additions & 2 deletions node_modules/hosted-git-info/lib/hosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ hosts.gitlab = {
blobpath: 'tree',
editpath: '-/edit',
tarballtemplate: ({ domain, user, project, committish }) =>
`https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || 'HEAD')}`,
`https://${domain}/api/v4/projects/${maybeEncode(user + '/' + project)}/repository/archive.tar.gz?sha=${maybeEncode(committish || 'HEAD')}`,
extract: (url) => {
const path = url.pathname.slice(1)
if (path.includes('/-/') || path.includes('/archive.tar.gz')) {
Expand Down Expand Up @@ -198,7 +198,7 @@ hosts.sourcehut = {
filetemplate: ({ domain, user, project, committish, path }) =>
`https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || 'HEAD'}/${path}`,
httpstemplate: ({ domain, user, project, committish }) =>
`https://${domain}/${user}/${project}.git${maybeJoin('#', committish)}`,
`https://${domain}/${user}/${project}${maybeJoin('#', committish)}`,
tarballtemplate: ({ domain, user, project, committish }) =>
`https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || 'HEAD'}.tar.gz`,
bugstemplate: () => null,
Expand Down
30 changes: 13 additions & 17 deletions node_modules/hosted-git-info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hosted-git-info",
"version": "9.0.2",
"version": "9.0.3",
"description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab",
"main": "./lib/index.js",
"repository": {
Expand All @@ -21,22 +21,23 @@
"homepage": "https://github.com/npm/hosted-git-info",
"scripts": {
"posttest": "npm run lint",
"snap": "tap",
"test": "tap",
"snap": "node --test --test-update-snapshots './test/**/*.js'",
"test": "node --test './test/**/*.js'",
"test:coverage": "tap --coverage-report=html",
"lint": "npm run eslint",
"postlint": "template-oss-check",
"lintfix": "npm run eslint -- --fix",
"template-oss-apply": "template-oss-apply --force",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"test:node20": "node --test test",
"test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'"
},
"dependencies": {
"lru-cache": "^11.1.0"
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.25.1",
"tap": "^16.0.1"
"@npmcli/eslint-config": "^6.0.0",
"@npmcli/template-oss": "4.30.0"
},
"files": [
"bin/",
Expand All @@ -45,17 +46,12 @@
"engines": {
"node": "^20.17.0 || >=22.9.0"
},
"tap": {
"color": 1,
"coverage": true,
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.25.1",
"publish": "true"
"version": "4.30.0",
"publish": "true",
"testRunner": "node:test",
"latestCiVersion": 24,
"updateNpm": false
}
}
21 changes: 21 additions & 0 deletions node_modules/ip-address/dist/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.isInSubnet = isInSubnet;
exports.isCorrect = isCorrect;
exports.prefixLengthFromMask = prefixLengthFromMask;
exports.numberToPaddedHex = numberToPaddedHex;
exports.stringToPaddedHex = stringToPaddedHex;
exports.testBit = testBit;
const address_error_1 = require("./address-error");
function isInSubnet(address) {
if (this.subnetMask < address.subnetMask) {
return false;
Expand All @@ -25,6 +27,25 @@ function isCorrect(defaultBits) {
return this.parsedSubnet === String(this.subnetMask);
};
}
/**
* Returns the prefix length (number of leading 1 bits) of a contiguous
* subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.
* `255.0.255.0`).
*/
function prefixLengthFromMask(value, totalBits) {
const binary = value.toString(2).padStart(totalBits, '0');
if (binary.length > totalBits) {
throw new address_error_1.AddressError('Invalid subnet mask.');
}
const firstZero = binary.indexOf('0');
if (firstZero === -1) {
return totalBits;
}
if (binary.slice(firstZero).includes('1')) {
throw new address_error_1.AddressError('Invalid subnet mask.');
}
return firstZero;
}
function numberToPaddedHex(number) {
return number.toString(16).padStart(2, '0');
}
Expand Down
Loading
Loading