Skip to content
Merged
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
12 changes: 6 additions & 6 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Check if childPath is within parentPath (prevents path traversal attacks)
* @param {string} childPath - The path to check
* @param {string} parentPath - The parent directory path
* @returns {boolean} - True if childPath is within parentPath

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"

Check warning on line 12 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Invalid JSDoc tag (preference). Replace "returns" JSDoc tag with "return"
*/
function isPathWithinParent(childPath, parentPath) {
const normalizedChild = path.resolve(childPath);
Expand All @@ -36,18 +36,18 @@
return isPathWithinParent(p, parentDir) || isPathWithinParent(p, realParentDir);
}

var relative = path.relative(parentDir, targetPath);
var segments = relative.split(path.sep);
var i = 0;
var current = parentDir;
const relative = path.relative(parentDir, targetPath);
const segments = relative.split(path.sep);
let i = 0;
let current = parentDir;

function checkNext() {
if (i >= segments.length) return callback(null, true);
var segment = segments[i++];
const segment = segments[i++];
if (!segment || segment === '.') return checkNext();

current = path.join(current, segment);
fs.lstat(current, function(err, stat) {

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.lstat()' instead

Check warning on line 50 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.lstat()' instead
if (err) {
if (err.code === 'ENOENT') return callback(null, true); // doesn't exist yet, safe
// Fail closed: unexpected filesystem errors are unsafe
Expand All @@ -55,13 +55,13 @@
}
if (!stat.isSymbolicLink()) return checkNext();

fs.realpath(current, function(err, resolved) {

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 58 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.realpath()' instead
if (err) {
if (err.code === 'ENOENT') {
// Dangling symlink - check textual target
return fs.readlink(current, function(err, linkTarget) {

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.readlink()' instead

Check warning on line 62 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.readlink()' instead
if (err) return callback(null, false);
var absTarget = path.resolve(path.dirname(current), linkTarget);
const absTarget = path.resolve(path.dirname(current), linkTarget);
callback(null, isWithinParent(absTarget));
});
}
Expand Down Expand Up @@ -172,7 +172,7 @@
// Resolve once for the entire extraction to handle OS-level symlinks
// (e.g. /var -> /private/var on macOS)
let realDestDir = resolvedDestDir;
fs.realpath(resolvedDestDir, (err, resolved) => {

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.realpath()' instead

Check warning on line 175 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.realpath()' instead
if (!err) realDestDir = resolved;

let entryCount = 0;
Expand Down Expand Up @@ -246,7 +246,7 @@
if (err) return reject(err);

const relativeTarget = path.relative(dir, target);
fs.symlink(relativeTarget, destFilePath, err => {

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 16)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 24)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 14)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 14)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 24)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 16)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 24)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 16)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 14)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.symlink()' instead

Check warning on line 249 in lib/utils.js

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use 'fs.promises.symlink()' instead
if (err) return reject(err);
successCount++;
stream.resume();
Expand Down
Loading