compressing 1.6.1 → 1.6.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.
package/README.md CHANGED
@@ -72,8 +72,8 @@ fs.createReadStream('file/path/to/compress')
72
72
  .on('error', handleError);
73
73
 
74
74
  // You should take care of stream errors in caution, use pump to handle error in one place
75
- const pump = require('pump';)
76
- const sourceStream = fs.createReadStream('file/path/to/compress')
75
+ const pump = require('pump');
76
+ const sourceStream = fs.createReadStream('file/path/to/compress');
77
77
  const gzipStream = new compressing.gzip.FileStream();
78
78
  const destStream = fs.createWriteStream('path/to/destination.gz');
79
79
  pump(sourceStream, gzipStream, destStream, handleError);
package/index.d.ts CHANGED
@@ -8,6 +8,7 @@ interface streamEntryOpts {
8
8
  relativePath?: string
9
9
  ignoreBase?: boolean
10
10
  size?: number
11
+ suppressSizeWarning?: boolean
11
12
  }
12
13
 
13
14
  interface streamHeader {
@@ -45,7 +45,7 @@ class TarFileStream extends stream.Transform {
45
45
  });
46
46
  } else {
47
47
  if (!opts.suppressSizeWarning) {
48
- console.warn('You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.supressSizeWarning: true to suppress this warning');
48
+ console.warn('You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.suppressSizeWarning: true to suppress this warning');
49
49
  }
50
50
  const buf = [];
51
51
  this.entry = new stream.Writable({
package/lib/tar/stream.js CHANGED
@@ -101,7 +101,7 @@ class TarStream extends BaseStream {
101
101
  entry.pipe(entryStream);
102
102
  } else {
103
103
  if (!opts.suppressSizeWarning) {
104
- console.warn('You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.supressSizeWarning: true to suppress this warning');
104
+ console.warn('You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.suppressSizeWarning: true to suppress this warning');
105
105
  }
106
106
  const buf = [];
107
107
  const collectStream = new stream.Writable({
package/lib/utils.js CHANGED
@@ -78,6 +78,11 @@ exports.makeUncompressFn = StreamClass => {
78
78
  return (source, destDir, opts) => {
79
79
  opts = opts || {};
80
80
  opts.source = source;
81
+ if (!source) { // !source 和 sourceType中返回undeined对应
82
+ const error = new Error('Type is not supported, must be a file path, file buffer, or a readable stream');
83
+ error.name = 'IlligalSourceError';
84
+ throw error;
85
+ }
81
86
  if (destType(destDir) !== 'path') {
82
87
  const error = new Error('uncompress destination must be a directory');
83
88
  error.name = 'IlligalDestError';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compressing",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Everything you need for compressing and uncompressing",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -53,7 +53,6 @@
53
53
  "@types/node": "^10.12.9",
54
54
  "dir-compare": "^1.3.0",
55
55
  "egg-bin": "^1.9.1",
56
- "egg-ci": "^2.1.0",
57
56
  "eslint": "^3.10.2",
58
57
  "eslint-config-egg": "^3.2.0",
59
58
  "git-contributor": "^1.1.0",
@@ -66,13 +65,5 @@
66
65
  },
67
66
  "engines": {
68
67
  "node": ">= 4.0.0"
69
- },
70
- "ci": {
71
- "version": "10, 12, 14, 16, 18",
72
- "os": "linux, macos",
73
- "license": {
74
- "year": "2017",
75
- "fullname": "node-modules and other contributors"
76
- }
77
68
  }
78
69
  }
package/History.md DELETED
@@ -1,97 +0,0 @@
1
-
2
- 1.6.1 / 2022-07-11
3
- ==================
4
-
5
- **fixes**
6
- * [[`ba49232`](http://github.com/node-modules/compressing/commit/ba49232780a57c9a3800642d7d39ae1dcdfc9409)] - fix(types): onEntry stream type should ReadStream (#73) (Songhn <<songhn233@gmail.com>>)
7
-
8
- **others**
9
- * [[`054d4a4`](http://github.com/node-modules/compressing/commit/054d4a41ae4ca5d7b9b83e7298e32cc1d62d7ef4)] - 🤖 TEST: Use GitHub Action (#69) (fengmk2 <<fengmk2@gmail.com>>)
10
-
11
- 1.6.0 / 2022-06-13
12
- ==================
13
-
14
- **features**
15
- * [[`bd8ef44`](http://github.com/node-modules/compressing/commit/bd8ef44ade2f4b93d41ff2f78d6f17902d965798)] - feat: unzip should keep file mode (#68) (Artin <<lengthmin@gmail.com>>)
16
-
17
- **others**
18
- * [[`592e518`](http://github.com/node-modules/compressing/commit/592e5180dfbdbc6cb1becd1baf6a007ce7b7cd39)] - Create codeql-analysis.yml (fengmk2 <<fengmk2@gmail.com>>)
19
-
20
- 1.5.1 / 2020-05-11
21
- ==================
22
-
23
- **fixes**
24
- * [[`f516814`](http://github.com/node-modules/compressing/commit/f51681490aeea44a7b27ec0c09d3fb3d0385c5c0)] - fix: index.d.ts streamHeader.name wrong declearing (#46) (shadyzoz <<ShadyZOZ@users.noreply.github.com>>)
25
-
26
- 1.5.0 / 2019-12-04
27
- ==================
28
-
29
- **features**
30
- * [[`15c29e9`](http://github.com/node-modules/compressing/commit/15c29e9893880d2c19c343d133edb50f0c55c713)] - feat: zip format support custom fileName encoding (#36) (fengmk2 <<fengmk2@gmail.com>>)
31
-
32
- **fixes**
33
- * [[`7d605fe`](http://github.com/node-modules/compressing/commit/7d605fe01a88bc6aab9a2b06a8725545f591bab9)] - fix: typescript error(#29) (Ruanyq <<yiqiang0930@163.com>>)
34
-
35
- **others**
36
- * [[`4808fb8`](http://github.com/node-modules/compressing/commit/4808fb8e1d6cbbb31c0e82c359ec04eccb0c1eaf)] - test: add node 11 (#20) (fengmk2 <<fengmk2@gmail.com>>)
37
-
38
- 1.4.0 / 2018-11-30
39
- ==================
40
-
41
- **others**
42
- * [[`1f352c8`](http://github.com/node-modules/compressing/commit/1f352c88028acf27c1881fd45d555094cb279c44)] - docs: add index.d.ts and test case (#17) (DiamondYuan <<541832074@qq.com>>)
43
-
44
- 1.3.2 / 2018-11-21
45
- ==================
46
-
47
- **fixes**
48
- * [[`3713a0b`](http://github.com/node-modules/compressing/commit/3713a0b8d5b03d61c111afbbd4b6226169afeb14)] - fix: handle error from yazl when file not exists (#19) (DiamondYuan <<541832074@qq.com>>)
49
-
50
- 1.3.1 / 2018-08-24
51
- ==================
52
-
53
- **fixes**
54
- * [[`b802819`](http://github.com/node-modules/compressing/commit/b8028195dd6e7200ff47c8f43f695d24838e986b)] - fix: keep stat mode when compress tar or tgz (#11) (Haoliang Gao <<sakura9515@gmail.com>>)
55
-
56
- 1.3.0 / 2018-08-13
57
- ==================
58
-
59
- **features**
60
- * [[`04feafa`](http://github.com/node-modules/compressing/commit/04feafa6a290d877044ed162ca4c7dcdc5e54e87)] - feat: support absolute path zip file (#10) (fengmk2 <<fengmk2@gmail.com>>)
61
-
62
- 1.2.4 / 2018-07-13
63
- ==================
64
-
65
- * chore: replace multipipe with pump (#9)
66
-
67
- 1.2.3 / 2017-07-27
68
- ==================
69
-
70
- * fix: should resolve when all fileWriteStream finished (#7)
71
-
72
- 1.2.2 / 2017-07-06
73
- ==================
74
-
75
- * fix: make file mode correct (#6)
76
-
77
- 1.2.1 / 2017-07-01
78
- ==================
79
-
80
- * test: fix test on Windows (#4)
81
-
82
- 1.2.0 / 2017-07-01
83
- ==================
84
-
85
- * feat: add strip option when uncompress zip
86
-
87
- 1.1.0 / 2017-02-14
88
- ==================
89
-
90
- * feat: uncompress (#2)
91
-
92
- 1.0.0 / 2016-12-24
93
- ==================
94
-
95
- * rename to compressing
96
- * feat: 1st implementation
97
- * init