@ezs/basics 2.5.1 → 2.5.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/lib/tar-extract.js +15 -8
- package/package.json +2 -2
package/lib/tar-extract.js
CHANGED
|
@@ -42,16 +42,23 @@ function TARExtract(data, feed) {
|
|
|
42
42
|
this.whenEnd = new Promise((resolve, reject) => {
|
|
43
43
|
extract.on('entry', async (header, stream, next) => {
|
|
44
44
|
if (_micromatch.default.isMatch(header.name, filesPatern)) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
try {
|
|
46
|
+
const contentRaw = await (0, _getStream.default)(stream);
|
|
47
|
+
if (json) {
|
|
48
|
+
const contentJson = JSON.parse(contentRaw);
|
|
49
|
+
return (0, _streamWrite.default)(this.output, contentJson, () => next());
|
|
50
|
+
}
|
|
51
|
+
return (0, _streamWrite.default)(this.output, {
|
|
52
|
+
id: header.name,
|
|
53
|
+
value: contentRaw
|
|
54
|
+
}, () => next());
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.warn(`WARNING: file was ignored (${header.name})`, e);
|
|
57
|
+
stream.resume();
|
|
58
|
+
return next();
|
|
49
59
|
}
|
|
50
|
-
return (0, _streamWrite.default)(this.output, {
|
|
51
|
-
id: header.name,
|
|
52
|
-
value: contentRaw
|
|
53
|
-
}, () => next());
|
|
54
60
|
}
|
|
61
|
+
stream.resume();
|
|
55
62
|
return next();
|
|
56
63
|
});
|
|
57
64
|
extract.on('error', reject);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezs/basics",
|
|
3
3
|
"description": "Basics statements for EZS",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.3",
|
|
5
5
|
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>",
|
|
6
6
|
"bugs": "https://github.com/Inist-CNRS/ezs/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"directories": {
|
|
42
42
|
"test": "test"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "3699fdbdf5ba6853d150ea82bbfe3e72bea1979d",
|
|
45
45
|
"homepage": "https://github.com/Inist-CNRS/ezs/tree/master/packages/basics#readme",
|
|
46
46
|
"keywords": [
|
|
47
47
|
"ezs"
|