addons-scanner-utils 9.11.0 → 9.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/functions.d.ts +0 -3
- package/dist/io/base.d.ts +1 -3
- package/dist/io/crx.d.ts +0 -2
- package/dist/io/crx.js +2 -2
- package/dist/io/directory.d.ts +0 -2
- package/dist/io/utils.d.ts +0 -1
- package/dist/io/utils.js +3 -3
- package/dist/io/xpi.d.ts +0 -2
- package/dist/io/xpi.js +3 -2
- package/dist/test-helpers.d.ts +0 -1
- package/package.json +12 -12
package/dist/functions.d.ts
CHANGED
package/dist/io/base.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { Readable } from 'stream';
|
|
4
2
|
import { Stderr } from '../stdio';
|
|
5
3
|
type ScanFileFunction = (_path: string, isDirectory: boolean) => boolean;
|
|
@@ -17,7 +15,7 @@ export declare class IOBase {
|
|
|
17
15
|
shouldScanFile: ScanFileFunction;
|
|
18
16
|
constructor({ filePath, stderr }: IOBaseConstructorParams);
|
|
19
17
|
setScanFileCallback(callback: ScanFileFunction): void;
|
|
20
|
-
getFile(path: string, fileStreamType?: 'stream' | 'string' | 'chunk'): Promise<string> | Promise<Buffer
|
|
18
|
+
getFile(path: string, fileStreamType?: 'stream' | 'string' | 'chunk'): Promise<string> | Promise<Buffer<ArrayBufferLike>> | Promise<Readable>;
|
|
21
19
|
getFilesByExt(...extensions: string[]): Promise<string[]>;
|
|
22
20
|
getFiles(optionalArgument?: Function): Promise<Files>;
|
|
23
21
|
getFileAsStream(path: string): Promise<Readable>;
|
package/dist/io/crx.d.ts
CHANGED
package/dist/io/crx.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Crx =
|
|
6
|
+
exports.Crx = void 0;
|
|
7
|
+
exports.defaultParseCRX = defaultParseCRX;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const yauzl_1 = __importDefault(require("yauzl"));
|
|
9
10
|
const xpi_1 = require("./xpi");
|
|
@@ -25,7 +26,6 @@ function defaultParseCRX(buf) {
|
|
|
25
26
|
}
|
|
26
27
|
throw new Error('Unexpected crx format version number.');
|
|
27
28
|
}
|
|
28
|
-
exports.defaultParseCRX = defaultParseCRX;
|
|
29
29
|
/*
|
|
30
30
|
* A CRX file is just a ZIP file (eg an XPI) with some extra header
|
|
31
31
|
* information. We handle opening the file with a CRX parser, then treat it
|
package/dist/io/directory.d.ts
CHANGED
package/dist/io/utils.d.ts
CHANGED
package/dist/io/utils.js
CHANGED
|
@@ -12,7 +12,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.readdir = exports.readFile = exports.lstat = void 0;
|
|
16
|
+
exports.walkPromise = walkPromise;
|
|
17
|
+
exports.checkFileExists = checkFileExists;
|
|
16
18
|
const fs_1 = __importDefault(require("fs"));
|
|
17
19
|
const path_1 = __importDefault(require("path"));
|
|
18
20
|
const util_1 = require("util");
|
|
@@ -50,7 +52,6 @@ function walkPromise(curPath, { shouldIncludePath = () => true, stderr }) {
|
|
|
50
52
|
};
|
|
51
53
|
return walk(curPath);
|
|
52
54
|
}
|
|
53
|
-
exports.walkPromise = walkPromise;
|
|
54
55
|
function checkFileExists(filePath_1) {
|
|
55
56
|
return __awaiter(this, arguments, void 0, function* (filePath, { _lstat = exports.lstat } = {}) {
|
|
56
57
|
const invalidMessage = new Error(`Path "${filePath}" is not a file or directory or does not exist.`);
|
|
@@ -69,4 +70,3 @@ function checkFileExists(filePath_1) {
|
|
|
69
70
|
throw invalidMessage;
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
exports.checkFileExists = checkFileExists;
|
package/dist/io/xpi.d.ts
CHANGED
package/dist/io/xpi.js
CHANGED
|
@@ -157,12 +157,13 @@ class Xpi extends base_1.IOBase {
|
|
|
157
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
158
|
const fileStream = yield this.getFileAsStream(path);
|
|
159
159
|
return new Promise((resolve, reject) => {
|
|
160
|
-
|
|
160
|
+
const chunks = [];
|
|
161
161
|
fileStream.on('data', (chunk) => {
|
|
162
|
-
|
|
162
|
+
chunks.push(chunk);
|
|
163
163
|
});
|
|
164
164
|
// Once the file is assembled, resolve the promise.
|
|
165
165
|
fileStream.on('end', () => {
|
|
166
|
+
const buf = Buffer.concat(chunks);
|
|
166
167
|
const fileString = buf.toString('utf8');
|
|
167
168
|
resolve(fileString);
|
|
168
169
|
});
|
package/dist/test-helpers.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "addons-scanner-utils",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.13.0",
|
|
4
4
|
"description": "Various addons related helpers to build CLIs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"yauzl": "2.10.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"body-parser": "1.20.
|
|
22
|
-
"express": "4.
|
|
21
|
+
"body-parser": "1.20.3",
|
|
22
|
+
"express": "4.21.2",
|
|
23
23
|
"node-fetch": "2.6.11",
|
|
24
24
|
"safe-compare": "1.1.4"
|
|
25
25
|
},
|
|
@@ -41,26 +41,26 @@
|
|
|
41
41
|
"@types/common-tags": "^1.8.0",
|
|
42
42
|
"@types/express": "4.17.21",
|
|
43
43
|
"@types/jest": "^29.0.0",
|
|
44
|
-
"@types/node": "^
|
|
44
|
+
"@types/node": "^22.0.0",
|
|
45
45
|
"@types/node-fetch": "^2.6.4",
|
|
46
46
|
"@types/safe-compare": "^1.1.0",
|
|
47
47
|
"@types/sinon": "^17.0.1",
|
|
48
48
|
"@types/supertest": "^6.0.2",
|
|
49
49
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
50
50
|
"@typescript-eslint/parser": "^6.7.0",
|
|
51
|
-
"body-parser": "1.20.
|
|
51
|
+
"body-parser": "1.20.3",
|
|
52
52
|
"eslint": "^8.1.0",
|
|
53
|
-
"eslint-config-amo": "^5.
|
|
54
|
-
"eslint-plugin-amo": "^
|
|
55
|
-
"express": "4.
|
|
53
|
+
"eslint-config-amo": "^5.12.0",
|
|
54
|
+
"eslint-plugin-amo": "^2.0.0",
|
|
55
|
+
"express": "4.21.2",
|
|
56
56
|
"jest": "^29.0.0",
|
|
57
57
|
"node-fetch": "2.6.11",
|
|
58
|
-
"prettier": "
|
|
59
|
-
"pretty-quick": "
|
|
58
|
+
"prettier": "3.5.3",
|
|
59
|
+
"pretty-quick": "4.1.1",
|
|
60
60
|
"rimraf": "^5.0.0",
|
|
61
61
|
"safe-compare": "1.1.4",
|
|
62
|
-
"sinon": "^
|
|
63
|
-
"supertest": "^
|
|
62
|
+
"sinon": "^20.0.0",
|
|
63
|
+
"supertest": "^7.0.0",
|
|
64
64
|
"ts-jest": "^29.0.0",
|
|
65
65
|
"type-coverage": "^2.3.0",
|
|
66
66
|
"typescript": "^5.0.2"
|