addons-scanner-utils 8.2.0 → 8.3.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/io/xpi.d.ts +2 -1
- package/dist/io/xpi.js +4 -2
- package/package.json +1 -1
package/dist/io/xpi.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
4
|
import yauzl, { Entry, ZipFile } from 'yauzl';
|
|
5
5
|
import { IOBaseConstructorParams, IOBase } from './base';
|
|
6
|
-
type Files = {
|
|
6
|
+
export type Files = {
|
|
7
7
|
[filename: string]: Entry;
|
|
8
8
|
};
|
|
9
9
|
type XpiConstructorParams = IOBaseConstructorParams & {
|
|
@@ -13,6 +13,7 @@ type XpiConstructorParams = IOBaseConstructorParams & {
|
|
|
13
13
|
export declare class Xpi extends IOBase {
|
|
14
14
|
autoClose: boolean;
|
|
15
15
|
files: Files;
|
|
16
|
+
processed: boolean;
|
|
16
17
|
zipLib: typeof yauzl;
|
|
17
18
|
zipfile: ZipFile | undefined;
|
|
18
19
|
constructor({ autoClose, filePath, stderr, zipLib, }: XpiConstructorParams);
|
package/dist/io/xpi.js
CHANGED
|
@@ -31,8 +31,9 @@ const errors_1 = require("../errors");
|
|
|
31
31
|
class Xpi extends base_1.IOBase {
|
|
32
32
|
constructor({ autoClose = true, filePath, stderr, zipLib = yauzl_1.default, }) {
|
|
33
33
|
super({ filePath, stderr });
|
|
34
|
-
this.files = {};
|
|
35
34
|
this.autoClose = autoClose;
|
|
35
|
+
this.files = {};
|
|
36
|
+
this.processed = false;
|
|
36
37
|
this.zipLib = zipLib;
|
|
37
38
|
}
|
|
38
39
|
open() {
|
|
@@ -85,7 +86,7 @@ class Xpi extends base_1.IOBase {
|
|
|
85
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
87
|
// If we have already processed the file and have data on this instance
|
|
87
88
|
// return that.
|
|
88
|
-
if (
|
|
89
|
+
if (this.processed) {
|
|
89
90
|
const wantedFiles = {};
|
|
90
91
|
Object.keys(this.files).forEach((fileName) => {
|
|
91
92
|
if (this.shouldScanFile(fileName, false)) {
|
|
@@ -114,6 +115,7 @@ class Xpi extends base_1.IOBase {
|
|
|
114
115
|
//
|
|
115
116
|
// See: https://github.com/mozilla/addons-linter/pull/43
|
|
116
117
|
zipfile.on('end', () => {
|
|
118
|
+
this.processed = true;
|
|
117
119
|
resolve(this.files);
|
|
118
120
|
});
|
|
119
121
|
if (_onEventsSubscribed) {
|