Bump the npm group with 4 updates (#2419)
* Bump the npm group with 4 updates Bumps the npm group with 4 updates: [adm-zip](https://github.com/cthackers/adm-zip), [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `adm-zip` from 0.5.14 to 0.5.15 - [Release notes](https://github.com/cthackers/adm-zip/releases) - [Changelog](https://github.com/cthackers/adm-zip/blob/master/history.md) - [Commits](https://github.com/cthackers/adm-zip/compare/v0.5.14...v0.5.15) Updates `@eslint/js` from 9.8.0 to 9.9.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/commits/v9.9.0/packages/js) Updates `@typescript-eslint/eslint-plugin` from 8.0.1 to 8.1.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.1.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.0.1 to 8.1.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.1.0/packages/parser) --- updated-dependencies: - dependency-name: adm-zip dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm - dependency-name: "@eslint/js" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
25ad3c8e40
commit
d620faa0b4
103 changed files with 1631 additions and 740 deletions
5
node_modules/adm-zip/util/decoder.js
generated
vendored
Normal file
5
node_modules/adm-zip/util/decoder.js
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
efs: true,
|
||||
encode: (data) => Buffer.from(data, "utf8"),
|
||||
decode: (data) => data.toString("utf8")
|
||||
};
|
||||
37
node_modules/adm-zip/util/errors.js
generated
vendored
37
node_modules/adm-zip/util/errors.js
generated
vendored
|
|
@ -1,13 +1,18 @@
|
|||
module.exports = {
|
||||
const errors = {
|
||||
/* Header error messages */
|
||||
INVALID_LOC: "Invalid LOC header (bad signature)",
|
||||
INVALID_CEN: "Invalid CEN header (bad signature)",
|
||||
INVALID_END: "Invalid END header (bad signature)",
|
||||
|
||||
/* Descriptor */
|
||||
DESCRIPTOR_NOT_EXIST: "No descriptor present",
|
||||
DESCRIPTOR_UNKNOWN: "Unknown descriptor format",
|
||||
DESCRIPTOR_FAULTY: "Descriptor data is malformed",
|
||||
|
||||
/* ZipEntry error messages*/
|
||||
NO_DATA: "Nothing to decompress",
|
||||
BAD_CRC: "CRC32 checksum failed",
|
||||
FILE_IN_THE_WAY: "There is a file in the way: %s",
|
||||
BAD_CRC: "CRC32 checksum failed {0}",
|
||||
FILE_IN_THE_WAY: "There is a file in the way: {0}",
|
||||
UNKNOWN_METHOD: "Invalid/unsupported compression method",
|
||||
|
||||
/* Inflater error messages */
|
||||
|
|
@ -29,8 +34,30 @@ module.exports = {
|
|||
NO_ZIP: "No zip file was loaded",
|
||||
NO_ENTRY: "Entry doesn't exist",
|
||||
DIRECTORY_CONTENT_ERROR: "A directory cannot have content",
|
||||
FILE_NOT_FOUND: "File not found: %s",
|
||||
FILE_NOT_FOUND: 'File not found: "{0}"',
|
||||
NOT_IMPLEMENTED: "Not implemented",
|
||||
INVALID_FILENAME: "Invalid filename",
|
||||
INVALID_FORMAT: "Invalid or unsupported zip format. No END header found"
|
||||
INVALID_FORMAT: "Invalid or unsupported zip format. No END header found",
|
||||
INVALID_PASS_PARAM: "Incompatible password parameter",
|
||||
WRONG_PASSWORD: "Wrong Password",
|
||||
|
||||
/* ADM-ZIP */
|
||||
COMMENT_TOO_LONG: "Comment is too long", // Comment can be max 65535 bytes long (NOTE: some non-US characters may take more space)
|
||||
EXTRA_FIELD_PARSE_ERROR: "Extra field parsing error"
|
||||
};
|
||||
|
||||
// template
|
||||
function E(message) {
|
||||
return function (...args) {
|
||||
if (args.length) { // Allow {0} .. {9} arguments in error message, based on argument number
|
||||
message = message.replace(/\{(\d)\}/g, (_, n) => args[n] || '');
|
||||
}
|
||||
|
||||
return new Error('ADM-ZIP: ' + message);
|
||||
};
|
||||
}
|
||||
|
||||
// Init errors with template
|
||||
for (const msg of Object.keys(errors)) {
|
||||
exports[msg] = E(errors[msg]);
|
||||
}
|
||||
|
|
|
|||
5
node_modules/adm-zip/util/fattr.js
generated
vendored
5
node_modules/adm-zip/util/fattr.js
generated
vendored
|
|
@ -1,9 +1,6 @@
|
|||
const fs = require("./fileSystem").require();
|
||||
const pth = require("path");
|
||||
|
||||
fs.existsSync = fs.existsSync || pth.existsSync;
|
||||
|
||||
module.exports = function (/*String*/ path) {
|
||||
module.exports = function (/*String*/ path, /*Utils object*/ { fs }) {
|
||||
var _path = path || "",
|
||||
_obj = newAttr(),
|
||||
_stat = null;
|
||||
|
|
|
|||
11
node_modules/adm-zip/util/fileSystem.js
generated
vendored
11
node_modules/adm-zip/util/fileSystem.js
generated
vendored
|
|
@ -1,11 +0,0 @@
|
|||
exports.require = function () {
|
||||
if (typeof process === "object" && process.versions && process.versions["electron"]) {
|
||||
try {
|
||||
const originalFs = require("original-fs");
|
||||
if (Object.keys(originalFs).length > 0) {
|
||||
return originalFs;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
return require("fs");
|
||||
};
|
||||
1
node_modules/adm-zip/util/index.js
generated
vendored
1
node_modules/adm-zip/util/index.js
generated
vendored
|
|
@ -2,3 +2,4 @@ module.exports = require("./utils");
|
|||
module.exports.Constants = require("./constants");
|
||||
module.exports.Errors = require("./errors");
|
||||
module.exports.FileAttr = require("./fattr");
|
||||
module.exports.decoder = require("./decoder");
|
||||
|
|
|
|||
137
node_modules/adm-zip/util/utils.js
generated
vendored
137
node_modules/adm-zip/util/utils.js
generated
vendored
|
|
@ -1,10 +1,10 @@
|
|||
const fsystem = require("./fileSystem").require();
|
||||
const fsystem = require("fs");
|
||||
const pth = require("path");
|
||||
const Constants = require("./constants");
|
||||
const Errors = require("./errors");
|
||||
const isWin = typeof process === "object" && "win32" === process.platform;
|
||||
|
||||
const is_Obj = (obj) => obj && typeof obj === "object";
|
||||
const is_Obj = (obj) => typeof obj === "object" && obj !== null;
|
||||
|
||||
// generate CRC32 lookup table
|
||||
const crcTable = new Uint32Array(256).map((t, c) => {
|
||||
|
|
@ -34,7 +34,7 @@ function Utils(opts) {
|
|||
|
||||
module.exports = Utils;
|
||||
|
||||
// INSTANCED functions
|
||||
// INSTANTIABLE functions
|
||||
|
||||
Utils.prototype.makeDir = function (/*String*/ folder) {
|
||||
const self = this;
|
||||
|
|
@ -51,7 +51,7 @@ Utils.prototype.makeDir = function (/*String*/ folder) {
|
|||
} catch (e) {
|
||||
self.fs.mkdirSync(resolvedPath);
|
||||
}
|
||||
if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath);
|
||||
if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY(`"${resolvedPath}"`);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -75,10 +75,10 @@ Utils.prototype.writeFileTo = function (/*String*/ path, /*Buffer*/ content, /*B
|
|||
|
||||
var fd;
|
||||
try {
|
||||
fd = self.fs.openSync(path, "w", 438); // 0666
|
||||
fd = self.fs.openSync(path, "w", 0o666); // 0666
|
||||
} catch (e) {
|
||||
self.fs.chmodSync(path, 438);
|
||||
fd = self.fs.openSync(path, "w", 438);
|
||||
self.fs.chmodSync(path, 0o666);
|
||||
fd = self.fs.openSync(path, "w", 0o666);
|
||||
}
|
||||
if (fd) {
|
||||
try {
|
||||
|
|
@ -87,7 +87,7 @@ Utils.prototype.writeFileTo = function (/*String*/ path, /*Buffer*/ content, /*B
|
|||
self.fs.closeSync(fd);
|
||||
}
|
||||
}
|
||||
self.fs.chmodSync(path, attr || 438);
|
||||
self.fs.chmodSync(path, attr || 0o666);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
|
@ -111,13 +111,13 @@ Utils.prototype.writeFileToAsync = function (/*String*/ path, /*Buffer*/ content
|
|||
self.fs.exists(folder, function (exists) {
|
||||
if (!exists) self.makeDir(folder);
|
||||
|
||||
self.fs.open(path, "w", 438, function (err, fd) {
|
||||
self.fs.open(path, "w", 0o666, function (err, fd) {
|
||||
if (err) {
|
||||
self.fs.chmod(path, 438, function () {
|
||||
self.fs.open(path, "w", 438, function (err, fd) {
|
||||
self.fs.chmod(path, 0o666, function () {
|
||||
self.fs.open(path, "w", 0o666, function (err, fd) {
|
||||
self.fs.write(fd, content, 0, content.length, 0, function () {
|
||||
self.fs.close(fd, function () {
|
||||
self.fs.chmod(path, attr || 438, function () {
|
||||
self.fs.chmod(path, attr || 0o666, function () {
|
||||
callback(true);
|
||||
});
|
||||
});
|
||||
|
|
@ -127,13 +127,13 @@ Utils.prototype.writeFileToAsync = function (/*String*/ path, /*Buffer*/ content
|
|||
} else if (fd) {
|
||||
self.fs.write(fd, content, 0, content.length, 0, function () {
|
||||
self.fs.close(fd, function () {
|
||||
self.fs.chmod(path, attr || 438, function () {
|
||||
self.fs.chmod(path, attr || 0o666, function () {
|
||||
callback(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
self.fs.chmod(path, attr || 438, function () {
|
||||
self.fs.chmod(path, attr || 0o666, function () {
|
||||
callback(true);
|
||||
});
|
||||
}
|
||||
|
|
@ -153,13 +153,14 @@ Utils.prototype.findFiles = function (/*String*/ path) {
|
|||
}
|
||||
let files = [];
|
||||
self.fs.readdirSync(dir).forEach(function (file) {
|
||||
var path = pth.join(dir, file);
|
||||
|
||||
if (self.fs.statSync(path).isDirectory() && recursive) files = files.concat(findSync(path, pattern, recursive));
|
||||
const path = pth.join(dir, file);
|
||||
const stat = self.fs.statSync(path);
|
||||
|
||||
if (!pattern || pattern.test(path)) {
|
||||
files.push(pth.normalize(path) + (self.fs.statSync(path).isDirectory() ? self.sep : ""));
|
||||
files.push(pth.normalize(path) + (stat.isDirectory() ? self.sep : ""));
|
||||
}
|
||||
|
||||
if (stat.isDirectory() && recursive) files = files.concat(findSync(path, pattern, recursive));
|
||||
});
|
||||
return files;
|
||||
}
|
||||
|
|
@ -167,6 +168,47 @@ Utils.prototype.findFiles = function (/*String*/ path) {
|
|||
return findSync(path, undefined, true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Callback for showing if everything was done.
|
||||
*
|
||||
* @callback filelistCallback
|
||||
* @param {Error} err - Error object
|
||||
* @param {string[]} list - was request fully completed
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} dir
|
||||
* @param {filelistCallback} cb
|
||||
*/
|
||||
Utils.prototype.findFilesAsync = function (dir, cb) {
|
||||
const self = this;
|
||||
let results = [];
|
||||
self.fs.readdir(dir, function (err, list) {
|
||||
if (err) return cb(err);
|
||||
let list_length = list.length;
|
||||
if (!list_length) return cb(null, results);
|
||||
list.forEach(function (file) {
|
||||
file = pth.join(dir, file);
|
||||
self.fs.stat(file, function (err, stat) {
|
||||
if (err) return cb(err);
|
||||
if (stat) {
|
||||
results.push(pth.normalize(file) + (stat.isDirectory() ? self.sep : ""));
|
||||
if (stat.isDirectory()) {
|
||||
self.findFilesAsync(file, function (err, res) {
|
||||
if (err) return cb(err);
|
||||
results = results.concat(res);
|
||||
if (!--list_length) cb(null, results);
|
||||
});
|
||||
} else {
|
||||
if (!--list_length) cb(null, results);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Utils.prototype.getAttributes = function () {};
|
||||
|
||||
Utils.prototype.setAttributes = function () {};
|
||||
|
|
@ -182,8 +224,6 @@ Utils.crc32 = function (buf) {
|
|||
if (typeof buf === "string") {
|
||||
buf = Buffer.from(buf, "utf8");
|
||||
}
|
||||
// Generate crcTable
|
||||
if (!crcTable.length) genCRCTable();
|
||||
|
||||
let len = buf.length;
|
||||
let crc = ~0;
|
||||
|
|
@ -203,14 +243,49 @@ Utils.methodToString = function (/*Number*/ method) {
|
|||
}
|
||||
};
|
||||
|
||||
// removes ".." style path elements
|
||||
/**
|
||||
* removes ".." style path elements
|
||||
* @param {string} path - fixable path
|
||||
* @returns string - fixed filepath
|
||||
*/
|
||||
Utils.canonical = function (/*string*/ path) {
|
||||
if (!path) return "";
|
||||
// trick normalize think path is absolute
|
||||
var safeSuffix = pth.posix.normalize("/" + path.split("\\").join("/"));
|
||||
const safeSuffix = pth.posix.normalize("/" + path.split("\\").join("/"));
|
||||
return pth.join(".", safeSuffix);
|
||||
};
|
||||
|
||||
/**
|
||||
* fix file names in achive
|
||||
* @param {string} path - fixable path
|
||||
* @returns string - fixed filepath
|
||||
*/
|
||||
|
||||
Utils.zipnamefix = function (path) {
|
||||
if (!path) return "";
|
||||
// trick normalize think path is absolute
|
||||
const safeSuffix = pth.posix.normalize("/" + path.split("\\").join("/"));
|
||||
return pth.posix.join(".", safeSuffix);
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Array} arr
|
||||
* @param {function} callback
|
||||
* @returns
|
||||
*/
|
||||
Utils.findLast = function (arr, callback) {
|
||||
if (!Array.isArray(arr)) throw new TypeError("arr is not array");
|
||||
|
||||
const len = arr.length >>> 0;
|
||||
for (let i = len - 1; i >= 0; i--) {
|
||||
if (callback(arr[i], i, arr)) {
|
||||
return arr[i];
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
// make abolute paths taking prefix as root folder
|
||||
Utils.sanitize = function (/*string*/ prefix, /*string*/ name) {
|
||||
prefix = pth.resolve(pth.normalize(prefix));
|
||||
|
|
@ -225,14 +300,14 @@ Utils.sanitize = function (/*string*/ prefix, /*string*/ name) {
|
|||
};
|
||||
|
||||
// converts buffer, Uint8Array, string types to buffer
|
||||
Utils.toBuffer = function toBuffer(/*buffer, Uint8Array, string*/ input) {
|
||||
Utils.toBuffer = function toBuffer(/*buffer, Uint8Array, string*/ input, /* function */ encoder) {
|
||||
if (Buffer.isBuffer(input)) {
|
||||
return input;
|
||||
} else if (input instanceof Uint8Array) {
|
||||
return Buffer.from(input);
|
||||
} else {
|
||||
// expect string all other values are invalid and return empty buffer
|
||||
return typeof input === "string" ? Buffer.from(input, "utf8") : Buffer.alloc(0);
|
||||
return typeof input === "string" ? encoder(input) : Buffer.alloc(0);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -243,5 +318,19 @@ Utils.readBigUInt64LE = function (/*Buffer*/ buffer, /*int*/ index) {
|
|||
return parseInt(`0x${slice.toString("hex")}`);
|
||||
};
|
||||
|
||||
Utils.fromDOS2Date = function (val) {
|
||||
return new Date(((val >> 25) & 0x7f) + 1980, Math.max(((val >> 21) & 0x0f) - 1, 0), Math.max((val >> 16) & 0x1f, 1), (val >> 11) & 0x1f, (val >> 5) & 0x3f, (val & 0x1f) << 1);
|
||||
};
|
||||
|
||||
Utils.fromDate2DOS = function (val) {
|
||||
let date = 0;
|
||||
let time = 0;
|
||||
if (val.getFullYear() > 1979) {
|
||||
date = (((val.getFullYear() - 1980) & 0x7f) << 9) | ((val.getMonth() + 1) << 5) | val.getDate();
|
||||
time = (val.getHours() << 11) | (val.getMinutes() << 5) | (val.getSeconds() >> 1);
|
||||
}
|
||||
return (date << 16) | time;
|
||||
};
|
||||
|
||||
Utils.isWin = isWin; // Do we have windows system
|
||||
Utils.crcTable = crcTable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue