muhammara 2.6.0 → 2.6.2
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/CHANGELOG.md +15 -1
- package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +3 -0
- package/node_modules/@mapbox/node-pre-gyp/README.md +1 -1
- package/node_modules/@mapbox/node-pre-gyp/package.json +5 -5
- package/node_modules/semver/classes/range.js +3 -0
- package/node_modules/semver/index.js +81 -41
- package/node_modules/semver/package.json +25 -14
- package/node_modules/tar/README.md +37 -9
- package/node_modules/tar/lib/create.js +16 -9
- package/node_modules/tar/lib/extract.js +16 -10
- package/node_modules/tar/lib/header.js +50 -34
- package/node_modules/tar/lib/large-numbers.js +22 -17
- package/node_modules/tar/lib/list.js +20 -13
- package/node_modules/tar/lib/mkdir.js +40 -24
- package/node_modules/tar/lib/mode-fix.js +8 -4
- package/node_modules/tar/lib/normalize-unicode.js +3 -2
- package/node_modules/tar/lib/pack.js +54 -31
- package/node_modules/tar/lib/parse.js +74 -46
- package/node_modules/tar/lib/path-reservations.js +26 -18
- package/node_modules/tar/lib/pax.js +15 -8
- package/node_modules/tar/lib/read-entry.js +14 -7
- package/node_modules/tar/lib/replace.js +50 -27
- package/node_modules/tar/lib/strip-absolute-path.js +1 -1
- package/node_modules/tar/lib/unpack.js +73 -44
- package/node_modules/tar/lib/update.js +8 -4
- package/node_modules/tar/lib/warn-mixin.js +7 -4
- package/node_modules/tar/lib/write-entry.js +44 -23
- package/node_modules/tar/package.json +44 -30
- package/package.json +1 -1
- package/src/deps/PDFWriter/CFFFileInput.cpp +7 -1
- package/src/deps/PDFWriter/DecryptionHelper.cpp +1 -1
- package/src/deps/PDFWriter/DocumentContext.cpp +21 -8
- package/src/deps/PDFWriter/DocumentContext.h +1 -1
- package/src/deps/PDFWriter/PDFModifiedPage.cpp +2 -0
- package/src/deps/PDFWriter/PDFPageInput.cpp +7 -1
- package/src/deps/PDFWriter/PDFParser.cpp +12 -0
- package/src/deps/PDFWriter/PDFUsedFont.cpp +4 -2
- package/src/deps/PDFWriter/TrueTypeEmbeddedFontWriter.cpp +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.6.2] - 2022-11-23
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Several cases of NPE under different circumstances
|
|
15
|
+
|
|
16
|
+
## [2.6.1] - 2022-10-23
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Backport: NPE in parser when file ends before it really starts
|
|
21
|
+
|
|
10
22
|
## [2.6.0] - 2022-06-30
|
|
11
23
|
|
|
12
24
|
### Changed
|
|
@@ -241,7 +253,9 @@ with the following changes.
|
|
|
241
253
|
|
|
242
254
|
* Initial release
|
|
243
255
|
|
|
244
|
-
[Unreleased]: https://github.com/julianhille/MuhammaraJS/compare/2.6.
|
|
256
|
+
[Unreleased]: https://github.com/julianhille/MuhammaraJS/compare/2.6.2...HEAD
|
|
257
|
+
[2.6.2]: https://github.com/julianhille/MuhammaraJS/compare/2.6.1...2.6.2
|
|
258
|
+
[2.6.1]: https://github.com/julianhille/MuhammaraJS/compare/2.6.0...2.6.1
|
|
245
259
|
[2.6.0]: https://github.com/julianhille/MuhammaraJS/compare/2.5.0...2.6.0
|
|
246
260
|
[2.5.0]: https://github.com/julianhille/MuhammaraJS/compare/2.4.0...2.5.0
|
|
247
261
|
[2.4.0]: https://github.com/julianhille/MuhammaraJS/compare/2.3.0...2.4.0
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# node-pre-gyp changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.10
|
|
4
|
+
- Upgraded minimist to 1.2.6 to address dependabot alert [CVE-2021-44906](https://nvd.nist.gov/vuln/detail/CVE-2021-44906)
|
|
5
|
+
|
|
3
6
|
## 1.0.9
|
|
4
7
|
- Upgraded node-fetch to 2.6.7 to address [CVE-2022-0235](https://www.cve.org/CVERecord?id=CVE-2022-0235)
|
|
5
8
|
- Upgraded detect-libc to 2.0.0 to use non-blocking NodeJS(>=12) Report API
|
|
@@ -81,7 +81,7 @@ Options include:
|
|
|
81
81
|
- `--runtime=node-webkit`: customize the runtime: `node`, `electron` and `node-webkit` are the valid options
|
|
82
82
|
- `--fallback-to-build`: fallback to building from source if pre-built binary is not available
|
|
83
83
|
- `--target=0.4.0`: Pass the target node or node-webkit version to compile against
|
|
84
|
-
- `--target_arch=ia32`: Pass the target arch and override the host `arch`.
|
|
84
|
+
- `--target_arch=ia32`: Pass the target arch and override the host `arch`. Any value that is [supported by Node.js](https://nodejs.org/api/os.html#osarch) is valid.
|
|
85
85
|
- `--target_platform=win32`: Pass the target platform and override the host `platform`. Valid values are `linux`, `darwin`, `win32`, `sunos`, `freebsd`, `openbsd`, and `aix`.
|
|
86
86
|
|
|
87
87
|
Both `--build-from-source` and `--fallback-to-build` can be passed alone or they can provide values. You can pass `--fallback-to-build=false` to override the option as declared in package.json. In addition to being able to pass `--build-from-source` you can also pass `--build-from-source=myapp` where `myapp` is the name of your module.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@mapbox/node-pre-gyp@^1.0.5",
|
|
3
|
-
"_id": "@mapbox/node-pre-gyp@1.0.
|
|
3
|
+
"_id": "@mapbox/node-pre-gyp@1.0.10",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==",
|
|
6
6
|
"_location": "/@mapbox/node-pre-gyp",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"_requiredBy": [
|
|
20
20
|
"/"
|
|
21
21
|
],
|
|
22
|
-
"_resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.
|
|
23
|
-
"_shasum": "
|
|
22
|
+
"_resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz",
|
|
23
|
+
"_shasum": "8e6735ccebbb1581e5a7e652244cadc8a844d03c",
|
|
24
24
|
"_spec": "@mapbox/node-pre-gyp@^1.0.5",
|
|
25
25
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS",
|
|
26
26
|
"author": {
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"update-crosswalk": "node scripts/abi_crosswalk.js",
|
|
94
94
|
"upload-coverage": "nyc report --reporter json && codecov --clear --flags=unit --file=./coverage/coverage-final.json"
|
|
95
95
|
},
|
|
96
|
-
"version": "1.0.
|
|
96
|
+
"version": "1.0.10"
|
|
97
97
|
}
|
|
@@ -252,6 +252,7 @@ const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
|
|
|
252
252
|
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
|
|
253
253
|
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
|
|
254
254
|
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
|
|
255
|
+
// ~0.0.1 --> >=0.0.1 <0.1.0-0
|
|
255
256
|
const replaceTildes = (comp, options) =>
|
|
256
257
|
comp.trim().split(/\s+/).map((c) => {
|
|
257
258
|
return replaceTilde(c, options)
|
|
@@ -291,6 +292,8 @@ const replaceTilde = (comp, options) => {
|
|
|
291
292
|
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
|
|
292
293
|
// ^1.2.3 --> >=1.2.3 <2.0.0-0
|
|
293
294
|
// ^1.2.0 --> >=1.2.0 <2.0.0-0
|
|
295
|
+
// ^0.0.1 --> >=0.0.1 <0.0.2-0
|
|
296
|
+
// ^0.1.0 --> >=0.1.0 <0.2.0-0
|
|
294
297
|
const replaceCarets = (comp, options) =>
|
|
295
298
|
comp.trim().split(/\s+/).map((c) => {
|
|
296
299
|
return replaceCaret(c, options)
|
|
@@ -1,48 +1,88 @@
|
|
|
1
1
|
// just pre-load all the stuff that index.js lazily exports
|
|
2
2
|
const internalRe = require('./internal/re')
|
|
3
|
+
const constants = require('./internal/constants')
|
|
4
|
+
const SemVer = require('./classes/semver')
|
|
5
|
+
const identifiers = require('./internal/identifiers')
|
|
6
|
+
const parse = require('./functions/parse')
|
|
7
|
+
const valid = require('./functions/valid')
|
|
8
|
+
const clean = require('./functions/clean')
|
|
9
|
+
const inc = require('./functions/inc')
|
|
10
|
+
const diff = require('./functions/diff')
|
|
11
|
+
const major = require('./functions/major')
|
|
12
|
+
const minor = require('./functions/minor')
|
|
13
|
+
const patch = require('./functions/patch')
|
|
14
|
+
const prerelease = require('./functions/prerelease')
|
|
15
|
+
const compare = require('./functions/compare')
|
|
16
|
+
const rcompare = require('./functions/rcompare')
|
|
17
|
+
const compareLoose = require('./functions/compare-loose')
|
|
18
|
+
const compareBuild = require('./functions/compare-build')
|
|
19
|
+
const sort = require('./functions/sort')
|
|
20
|
+
const rsort = require('./functions/rsort')
|
|
21
|
+
const gt = require('./functions/gt')
|
|
22
|
+
const lt = require('./functions/lt')
|
|
23
|
+
const eq = require('./functions/eq')
|
|
24
|
+
const neq = require('./functions/neq')
|
|
25
|
+
const gte = require('./functions/gte')
|
|
26
|
+
const lte = require('./functions/lte')
|
|
27
|
+
const cmp = require('./functions/cmp')
|
|
28
|
+
const coerce = require('./functions/coerce')
|
|
29
|
+
const Comparator = require('./classes/comparator')
|
|
30
|
+
const Range = require('./classes/range')
|
|
31
|
+
const satisfies = require('./functions/satisfies')
|
|
32
|
+
const toComparators = require('./ranges/to-comparators')
|
|
33
|
+
const maxSatisfying = require('./ranges/max-satisfying')
|
|
34
|
+
const minSatisfying = require('./ranges/min-satisfying')
|
|
35
|
+
const minVersion = require('./ranges/min-version')
|
|
36
|
+
const validRange = require('./ranges/valid')
|
|
37
|
+
const outside = require('./ranges/outside')
|
|
38
|
+
const gtr = require('./ranges/gtr')
|
|
39
|
+
const ltr = require('./ranges/ltr')
|
|
40
|
+
const intersects = require('./ranges/intersects')
|
|
41
|
+
const simplifyRange = require('./ranges/simplify')
|
|
42
|
+
const subset = require('./ranges/subset')
|
|
3
43
|
module.exports = {
|
|
44
|
+
parse,
|
|
45
|
+
valid,
|
|
46
|
+
clean,
|
|
47
|
+
inc,
|
|
48
|
+
diff,
|
|
49
|
+
major,
|
|
50
|
+
minor,
|
|
51
|
+
patch,
|
|
52
|
+
prerelease,
|
|
53
|
+
compare,
|
|
54
|
+
rcompare,
|
|
55
|
+
compareLoose,
|
|
56
|
+
compareBuild,
|
|
57
|
+
sort,
|
|
58
|
+
rsort,
|
|
59
|
+
gt,
|
|
60
|
+
lt,
|
|
61
|
+
eq,
|
|
62
|
+
neq,
|
|
63
|
+
gte,
|
|
64
|
+
lte,
|
|
65
|
+
cmp,
|
|
66
|
+
coerce,
|
|
67
|
+
Comparator,
|
|
68
|
+
Range,
|
|
69
|
+
satisfies,
|
|
70
|
+
toComparators,
|
|
71
|
+
maxSatisfying,
|
|
72
|
+
minSatisfying,
|
|
73
|
+
minVersion,
|
|
74
|
+
validRange,
|
|
75
|
+
outside,
|
|
76
|
+
gtr,
|
|
77
|
+
ltr,
|
|
78
|
+
intersects,
|
|
79
|
+
simplifyRange,
|
|
80
|
+
subset,
|
|
81
|
+
SemVer,
|
|
4
82
|
re: internalRe.re,
|
|
5
83
|
src: internalRe.src,
|
|
6
84
|
tokens: internalRe.t,
|
|
7
|
-
SEMVER_SPEC_VERSION:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,
|
|
11
|
-
parse: require('./functions/parse'),
|
|
12
|
-
valid: require('./functions/valid'),
|
|
13
|
-
clean: require('./functions/clean'),
|
|
14
|
-
inc: require('./functions/inc'),
|
|
15
|
-
diff: require('./functions/diff'),
|
|
16
|
-
major: require('./functions/major'),
|
|
17
|
-
minor: require('./functions/minor'),
|
|
18
|
-
patch: require('./functions/patch'),
|
|
19
|
-
prerelease: require('./functions/prerelease'),
|
|
20
|
-
compare: require('./functions/compare'),
|
|
21
|
-
rcompare: require('./functions/rcompare'),
|
|
22
|
-
compareLoose: require('./functions/compare-loose'),
|
|
23
|
-
compareBuild: require('./functions/compare-build'),
|
|
24
|
-
sort: require('./functions/sort'),
|
|
25
|
-
rsort: require('./functions/rsort'),
|
|
26
|
-
gt: require('./functions/gt'),
|
|
27
|
-
lt: require('./functions/lt'),
|
|
28
|
-
eq: require('./functions/eq'),
|
|
29
|
-
neq: require('./functions/neq'),
|
|
30
|
-
gte: require('./functions/gte'),
|
|
31
|
-
lte: require('./functions/lte'),
|
|
32
|
-
cmp: require('./functions/cmp'),
|
|
33
|
-
coerce: require('./functions/coerce'),
|
|
34
|
-
Comparator: require('./classes/comparator'),
|
|
35
|
-
Range: require('./classes/range'),
|
|
36
|
-
satisfies: require('./functions/satisfies'),
|
|
37
|
-
toComparators: require('./ranges/to-comparators'),
|
|
38
|
-
maxSatisfying: require('./ranges/max-satisfying'),
|
|
39
|
-
minSatisfying: require('./ranges/min-satisfying'),
|
|
40
|
-
minVersion: require('./ranges/min-version'),
|
|
41
|
-
validRange: require('./ranges/valid'),
|
|
42
|
-
outside: require('./ranges/outside'),
|
|
43
|
-
gtr: require('./ranges/gtr'),
|
|
44
|
-
ltr: require('./ranges/ltr'),
|
|
45
|
-
intersects: require('./ranges/intersects'),
|
|
46
|
-
simplifyRange: require('./ranges/simplify'),
|
|
47
|
-
subset: require('./ranges/subset'),
|
|
85
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
86
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
87
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers,
|
|
48
88
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "semver@^7.3.5",
|
|
3
|
-
"_id": "semver@7.3.
|
|
3
|
+
"_id": "semver@7.3.8",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
|
|
6
6
|
"_location": "/semver",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/@mapbox/node-pre-gyp"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/semver/-/semver-7.3.
|
|
22
|
-
"_shasum": "
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
|
|
22
|
+
"_shasum": "07a78feafb3f7b32347d725e33de7e2a2df67798",
|
|
23
23
|
"_spec": "semver@^7.3.5",
|
|
24
24
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/@mapbox/node-pre-gyp",
|
|
25
25
|
"author": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"description": "The semantic version parser used by npm.",
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@npmcli/eslint-config": "^3.0.1",
|
|
42
|
-
"@npmcli/template-oss": "
|
|
42
|
+
"@npmcli/template-oss": "4.4.4",
|
|
43
43
|
"tap": "^16.0.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
49
|
"bin/",
|
|
50
|
+
"lib/",
|
|
50
51
|
"classes/",
|
|
51
52
|
"functions/",
|
|
52
53
|
"internal/",
|
|
@@ -67,32 +68,33 @@
|
|
|
67
68
|
"lint": "eslint \"**/*.js\"",
|
|
68
69
|
"lintfix": "npm run lint -- --fix",
|
|
69
70
|
"postlint": "template-oss-check",
|
|
70
|
-
"postpublish": "git push origin --follow-tags",
|
|
71
71
|
"posttest": "npm run lint",
|
|
72
|
-
"postversion": "npm publish",
|
|
73
|
-
"prepublishOnly": "git push origin --follow-tags",
|
|
74
|
-
"preversion": "npm test",
|
|
75
72
|
"snap": "tap",
|
|
76
73
|
"template-oss-apply": "template-oss-apply --force",
|
|
77
74
|
"test": "tap"
|
|
78
75
|
},
|
|
79
76
|
"tap": {
|
|
80
77
|
"check-coverage": true,
|
|
81
|
-
"coverage-map": "map.js"
|
|
78
|
+
"coverage-map": "map.js",
|
|
79
|
+
"nyc-arg": [
|
|
80
|
+
"--exclude",
|
|
81
|
+
"tap-snapshots/**"
|
|
82
|
+
]
|
|
82
83
|
},
|
|
83
84
|
"templateOSS": {
|
|
84
85
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
85
|
-
"version": "
|
|
86
|
+
"version": "4.4.4",
|
|
86
87
|
"engines": ">=10",
|
|
88
|
+
"content": "./scripts",
|
|
87
89
|
"ciVersions": [
|
|
88
90
|
"10.0.0",
|
|
89
91
|
"10.x",
|
|
90
92
|
"12.x",
|
|
91
93
|
"14.x",
|
|
92
|
-
"16.x"
|
|
94
|
+
"16.x",
|
|
95
|
+
"18.x"
|
|
93
96
|
],
|
|
94
97
|
"distPaths": [
|
|
95
|
-
"bin/",
|
|
96
98
|
"classes/",
|
|
97
99
|
"functions/",
|
|
98
100
|
"internal/",
|
|
@@ -100,7 +102,16 @@
|
|
|
100
102
|
"index.js",
|
|
101
103
|
"preload.js",
|
|
102
104
|
"range.bnf"
|
|
105
|
+
],
|
|
106
|
+
"allowPaths": [
|
|
107
|
+
"/classes/",
|
|
108
|
+
"/functions/",
|
|
109
|
+
"/internal/",
|
|
110
|
+
"/ranges/",
|
|
111
|
+
"/index.js",
|
|
112
|
+
"/preload.js",
|
|
113
|
+
"/range.bnf"
|
|
103
114
|
]
|
|
104
115
|
},
|
|
105
|
-
"version": "7.3.
|
|
116
|
+
"version": "7.3.8"
|
|
106
117
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# node-tar
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Fast and full-featured Tar for Node.js
|
|
4
4
|
|
|
5
5
|
The API is designed to mimic the behavior of `tar(1)` on unix systems.
|
|
6
6
|
If you are familiar with how tar works, most of this will hopefully be
|
|
@@ -209,6 +209,19 @@ tar.t({
|
|
|
209
209
|
})
|
|
210
210
|
```
|
|
211
211
|
|
|
212
|
+
For example, to just get the list of filenames from an archive:
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
const getEntryFilenames = async tarballFilename => {
|
|
216
|
+
const filenames = []
|
|
217
|
+
await tar.t({
|
|
218
|
+
file: tarballFilename,
|
|
219
|
+
onentry: entry => filenames.push(entry.path),
|
|
220
|
+
})
|
|
221
|
+
return filenames
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
212
225
|
To replicate `cat my-tarball.tgz | tar t` do:
|
|
213
226
|
|
|
214
227
|
```js
|
|
@@ -223,6 +236,18 @@ When the function returns, it's already done. Sync methods without a
|
|
|
223
236
|
file argument return a sync stream, which flushes immediately. But,
|
|
224
237
|
of course, it still won't be done until you `.end()` it.
|
|
225
238
|
|
|
239
|
+
```js
|
|
240
|
+
const getEntryFilenamesSync = tarballFilename => {
|
|
241
|
+
const filenames = []
|
|
242
|
+
tar.t({
|
|
243
|
+
file: tarballFilename,
|
|
244
|
+
onentry: entry => filenames.push(entry.path),
|
|
245
|
+
sync: true,
|
|
246
|
+
})
|
|
247
|
+
return filenames
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
226
251
|
To filter entries, add `filter: <function>` to the options.
|
|
227
252
|
Tar-creating methods call the filter with `filter(path, stat)`.
|
|
228
253
|
Tar-reading methods (including extraction) call the filter with
|
|
@@ -429,15 +454,18 @@ no paths are provided, then all the entries are listed.
|
|
|
429
454
|
|
|
430
455
|
If the archive is gzipped, then tar will detect this and unzip it.
|
|
431
456
|
|
|
432
|
-
|
|
433
|
-
`tar.ReadEntry` objects. However, they don't
|
|
434
|
-
events. (If you want to get actual readable
|
|
435
|
-
`tar.Parse` class instead.)
|
|
457
|
+
If the `file` option is _not_ provided, then returns an event emitter that
|
|
458
|
+
emits `entry` events with `tar.ReadEntry` objects. However, they don't
|
|
459
|
+
emit `'data'` or `'end'` events. (If you want to get actual readable
|
|
460
|
+
entries, use the `tar.Parse` class instead.)
|
|
461
|
+
|
|
462
|
+
If a `file` option _is_ provided, then the return value will be a promise
|
|
463
|
+
that resolves when the file has been fully traversed in async mode, or
|
|
464
|
+
`undefined` if `sync: true` is set. Thus, you _must_ specify an `onentry`
|
|
465
|
+
method in order to do anything useful with the data it parses.
|
|
436
466
|
|
|
437
467
|
The following options are supported:
|
|
438
468
|
|
|
439
|
-
- `cwd` Extract files relative to the specified directory. Defaults
|
|
440
|
-
to `process.cwd()`. [Alias: `C`]
|
|
441
469
|
- `file` The archive file to list. If not specified, then a
|
|
442
470
|
Writable stream is returned where the archive data should be
|
|
443
471
|
written. [Alias: `f`]
|
|
@@ -449,8 +477,8 @@ The following options are supported:
|
|
|
449
477
|
entry being listed. Return `true` to emit the entry from the
|
|
450
478
|
archive, or `false` to skip it.
|
|
451
479
|
- `onentry` A function that gets called with `(entry)` for each entry
|
|
452
|
-
that passes the filter. This is important for when
|
|
453
|
-
|
|
480
|
+
that passes the filter. This is important for when `file` is set,
|
|
481
|
+
because there is no other way to do anything useful with this method.
|
|
454
482
|
- `maxReadSize` The maximum buffer size for `fs.read()` operations.
|
|
455
483
|
Defaults to 16 MB.
|
|
456
484
|
- `noResume` By default, `entry` streams are resumed immediately after
|
|
@@ -9,24 +9,29 @@ const t = require('./list.js')
|
|
|
9
9
|
const path = require('path')
|
|
10
10
|
|
|
11
11
|
module.exports = (opt_, files, cb) => {
|
|
12
|
-
if (typeof files === 'function')
|
|
12
|
+
if (typeof files === 'function') {
|
|
13
13
|
cb = files
|
|
14
|
+
}
|
|
14
15
|
|
|
15
|
-
if (Array.isArray(opt_))
|
|
16
|
+
if (Array.isArray(opt_)) {
|
|
16
17
|
files = opt_, opt_ = {}
|
|
18
|
+
}
|
|
17
19
|
|
|
18
|
-
if (!files || !Array.isArray(files) || !files.length)
|
|
20
|
+
if (!files || !Array.isArray(files) || !files.length) {
|
|
19
21
|
throw new TypeError('no files or directories specified')
|
|
22
|
+
}
|
|
20
23
|
|
|
21
24
|
files = Array.from(files)
|
|
22
25
|
|
|
23
26
|
const opt = hlo(opt_)
|
|
24
27
|
|
|
25
|
-
if (opt.sync && typeof cb === 'function')
|
|
28
|
+
if (opt.sync && typeof cb === 'function') {
|
|
26
29
|
throw new TypeError('callback not supported for sync tar functions')
|
|
30
|
+
}
|
|
27
31
|
|
|
28
|
-
if (!opt.file && typeof cb === 'function')
|
|
32
|
+
if (!opt.file && typeof cb === 'function') {
|
|
29
33
|
throw new TypeError('callback only supported with file option')
|
|
34
|
+
}
|
|
30
35
|
|
|
31
36
|
return opt.file && opt.sync ? createFileSync(opt, files)
|
|
32
37
|
: opt.file ? createFile(opt, files, cb)
|
|
@@ -65,13 +70,14 @@ const addFilesSync = (p, files) => {
|
|
|
65
70
|
files.forEach(file => {
|
|
66
71
|
if (file.charAt(0) === '@') {
|
|
67
72
|
t({
|
|
68
|
-
file: path.resolve(p.cwd, file.
|
|
73
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
|
69
74
|
sync: true,
|
|
70
75
|
noResume: true,
|
|
71
76
|
onentry: entry => p.add(entry),
|
|
72
77
|
})
|
|
73
|
-
} else
|
|
78
|
+
} else {
|
|
74
79
|
p.add(file)
|
|
80
|
+
}
|
|
75
81
|
})
|
|
76
82
|
p.end()
|
|
77
83
|
}
|
|
@@ -81,12 +87,13 @@ const addFilesAsync = (p, files) => {
|
|
|
81
87
|
const file = files.shift()
|
|
82
88
|
if (file.charAt(0) === '@') {
|
|
83
89
|
return t({
|
|
84
|
-
file: path.resolve(p.cwd, file.
|
|
90
|
+
file: path.resolve(p.cwd, file.slice(1)),
|
|
85
91
|
noResume: true,
|
|
86
92
|
onentry: entry => p.add(entry),
|
|
87
93
|
}).then(_ => addFilesAsync(p, files))
|
|
88
|
-
} else
|
|
94
|
+
} else {
|
|
89
95
|
p.add(file)
|
|
96
|
+
}
|
|
90
97
|
}
|
|
91
98
|
p.end()
|
|
92
99
|
}
|
|
@@ -9,29 +9,35 @@ const path = require('path')
|
|
|
9
9
|
const stripSlash = require('./strip-trailing-slashes.js')
|
|
10
10
|
|
|
11
11
|
module.exports = (opt_, files, cb) => {
|
|
12
|
-
if (typeof opt_ === 'function')
|
|
12
|
+
if (typeof opt_ === 'function') {
|
|
13
13
|
cb = opt_, files = null, opt_ = {}
|
|
14
|
-
else if (Array.isArray(opt_))
|
|
14
|
+
} else if (Array.isArray(opt_)) {
|
|
15
15
|
files = opt_, opt_ = {}
|
|
16
|
+
}
|
|
16
17
|
|
|
17
|
-
if (typeof files === 'function')
|
|
18
|
+
if (typeof files === 'function') {
|
|
18
19
|
cb = files, files = null
|
|
20
|
+
}
|
|
19
21
|
|
|
20
|
-
if (!files)
|
|
22
|
+
if (!files) {
|
|
21
23
|
files = []
|
|
22
|
-
else
|
|
24
|
+
} else {
|
|
23
25
|
files = Array.from(files)
|
|
26
|
+
}
|
|
24
27
|
|
|
25
28
|
const opt = hlo(opt_)
|
|
26
29
|
|
|
27
|
-
if (opt.sync && typeof cb === 'function')
|
|
30
|
+
if (opt.sync && typeof cb === 'function') {
|
|
28
31
|
throw new TypeError('callback not supported for sync tar functions')
|
|
32
|
+
}
|
|
29
33
|
|
|
30
|
-
if (!opt.file && typeof cb === 'function')
|
|
34
|
+
if (!opt.file && typeof cb === 'function') {
|
|
31
35
|
throw new TypeError('callback only supported with file option')
|
|
36
|
+
}
|
|
32
37
|
|
|
33
|
-
if (files.length)
|
|
38
|
+
if (files.length) {
|
|
34
39
|
filesFilter(opt, files)
|
|
40
|
+
}
|
|
35
41
|
|
|
36
42
|
return opt.file && opt.sync ? extractFileSync(opt)
|
|
37
43
|
: opt.file ? extractFile(opt, cb)
|
|
@@ -87,9 +93,9 @@ const extractFile = (opt, cb) => {
|
|
|
87
93
|
// This trades a zero-byte read() syscall for a stat
|
|
88
94
|
// However, it will usually result in less memory allocation
|
|
89
95
|
fs.stat(file, (er, stat) => {
|
|
90
|
-
if (er)
|
|
96
|
+
if (er) {
|
|
91
97
|
reject(er)
|
|
92
|
-
else {
|
|
98
|
+
} else {
|
|
93
99
|
const stream = new fsm.ReadStream(file, {
|
|
94
100
|
readSize: readSize,
|
|
95
101
|
size: stat.size,
|