zip-lib 0.7.2 → 0.7.3

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.
@@ -14,7 +14,7 @@ export declare class CancellationToken {
14
14
  /**
15
15
  * Subscribe a callback when cancellation is requested. The callback
16
16
  * only ever fires `once` as cancellation can only happen once.
17
- * @param cb A function will be called whent cancellation is requested.
17
+ * @param cb A function will be called when cancellation is requested.
18
18
  * @returns A function that Unsubscribe the cancellation callback.
19
19
  */
20
20
  onCancelled(cb: () => void): () => void;
package/lib/cancelable.js CHANGED
@@ -15,7 +15,7 @@ class CancellationToken {
15
15
  /**
16
16
  * Subscribe a callback when cancellation is requested. The callback
17
17
  * only ever fires `once` as cancellation can only happen once.
18
- * @param cb A function will be called whent cancellation is requested.
18
+ * @param cb A function will be called when cancellation is requested.
19
19
  * @returns A function that Unsubscribe the cancellation callback.
20
20
  */
21
21
  onCancelled(cb) {
package/lib/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/lib/unzip.js CHANGED
@@ -286,7 +286,7 @@ class Unzip extends cancelable_1.Cancelable {
286
286
  });
287
287
  }
288
288
  else {
289
- fileStream = fs_1.createWriteStream(filePath, { mode });
289
+ fileStream = (0, fs_1.createWriteStream)(filePath, { mode });
290
290
  fileStream.once("close", () => c());
291
291
  fileStream.once("error", (err) => {
292
292
  e(this.wrapError(err, token.isCancelled));
package/lib/zip.js CHANGED
@@ -70,7 +70,7 @@ class Zip extends cancelable_1.Cancelable {
70
70
  });
71
71
  const zip = this.yazlFile;
72
72
  if (!token.isCancelled) {
73
- this.zipStream = fs_1.createWriteStream(zipFile);
73
+ this.zipStream = (0, fs_1.createWriteStream)(zipFile);
74
74
  this.zipStream.once("error", (err) => {
75
75
  e(this.wrapError(err, token.isCancelled));
76
76
  });
@@ -145,7 +145,7 @@ class Zip extends cancelable_1.Cancelable {
145
145
  }
146
146
  addFileStream(zip, file, metadataPath, token) {
147
147
  return new Promise((c, e) => {
148
- const fileStream = fs_1.createReadStream(file.path);
148
+ const fileStream = (0, fs_1.createReadStream)(file.path);
149
149
  fileStream.once("error", (err) => {
150
150
  const wrappedError = this.wrapError(err, token.isCancelled);
151
151
  this.stopPipe(wrappedError);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zip-lib",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "zip and unzip library for node",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -19,9 +19,12 @@
19
19
  },
20
20
  "keywords": [
21
21
  "zip",
22
+ "folder",
22
23
  "unzip",
23
24
  "archive",
24
- "extract"
25
+ "extract",
26
+ "promise",
27
+ "async"
25
28
  ],
26
29
  "author": "fpsqdb",
27
30
  "license": "MIT",
@@ -30,11 +33,11 @@
30
33
  "yazl": "^2.5.1"
31
34
  },
32
35
  "devDependencies": {
33
- "@types/mocha": "^8.2.0",
36
+ "@types/mocha": "^9.1.0",
34
37
  "@types/node": "^8.10.66",
35
38
  "@types/yauzl": "^2.9.1",
36
39
  "@types/yazl": "^2.4.2",
37
- "mocha": "^8.2.1",
40
+ "mocha": "^9.2.0",
38
41
  "rimraf": "^3.0.2",
39
42
  "typescript": "^4.1.3"
40
43
  }