tar 2.2.1 → 2.2.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/.nyc_output/0471d9cf-687f-4ae8-84a5-ce7468becd03.json +1 -0
- package/.nyc_output/12bca2bc-6a2b-4f45-abc7-8483922a524d.json +1 -0
- package/.nyc_output/37d58de4-deea-4808-bb77-d27685bd1501.json +1 -0
- package/.nyc_output/5ad8066b-6b8c-4bc8-b807-c40bf80898b7.json +1 -0
- package/.nyc_output/5cbf674c-7089-4b7d-b9de-2119be4dbb0b.json +1 -0
- package/.nyc_output/7853e29b-78ef-4ab4-b8fb-e1e176c0787b.json +1 -0
- package/.nyc_output/9d414044-b18d-4f6d-b2e0-531a89bf6f4f.json +1 -0
- package/.nyc_output/c3ffeb8c-8e79-4a2c-b678-e5a917fe721e.json +1 -0
- package/.nyc_output/ea0194cb-f599-402f-8876-84fb8251e8db.json +1 -0
- package/.nyc_output/eda6b7a3-5e15-440f-8619-e11a15a07f77.json +1 -0
- package/.nyc_output/fb518800-240c-42ff-811f-79e92708d9db.json +1 -0
- package/.nyc_output/fdecfc06-a944-4897-9530-e08f62883fc1.json +1 -0
- package/.nyc_output/processinfo/0471d9cf-687f-4ae8-84a5-ce7468becd03.json +1 -0
- package/.nyc_output/processinfo/12bca2bc-6a2b-4f45-abc7-8483922a524d.json +1 -0
- package/.nyc_output/processinfo/37d58de4-deea-4808-bb77-d27685bd1501.json +1 -0
- package/.nyc_output/processinfo/5ad8066b-6b8c-4bc8-b807-c40bf80898b7.json +1 -0
- package/.nyc_output/processinfo/5cbf674c-7089-4b7d-b9de-2119be4dbb0b.json +1 -0
- package/.nyc_output/processinfo/7853e29b-78ef-4ab4-b8fb-e1e176c0787b.json +1 -0
- package/.nyc_output/processinfo/9d414044-b18d-4f6d-b2e0-531a89bf6f4f.json +1 -0
- package/.nyc_output/processinfo/c3ffeb8c-8e79-4a2c-b678-e5a917fe721e.json +1 -0
- package/.nyc_output/processinfo/ea0194cb-f599-402f-8876-84fb8251e8db.json +1 -0
- package/.nyc_output/processinfo/eda6b7a3-5e15-440f-8619-e11a15a07f77.json +1 -0
- package/.nyc_output/processinfo/fb518800-240c-42ff-811f-79e92708d9db.json +1 -0
- package/.nyc_output/processinfo/fdecfc06-a944-4897-9530-e08f62883fc1.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/coverage/lcov-report/base.css +212 -0
- package/coverage/lcov-report/index.html +106 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +1 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +158 -0
- package/coverage/lcov-report/tar/index.html +93 -0
- package/coverage/lcov-report/tar/index.js.html +119 -0
- package/coverage/lcov-report/tar/lib/create.js.html +380 -0
- package/coverage/lcov-report/tar/lib/extract.js.html +401 -0
- package/coverage/lcov-report/tar/lib/header.js.html +881 -0
- package/coverage/lcov-report/tar/lib/high-level-opt.js.html +152 -0
- package/coverage/lcov-report/tar/lib/index.html +314 -0
- package/coverage/lcov-report/tar/lib/large-numbers.js.html +341 -0
- package/coverage/lcov-report/tar/lib/list.js.html +449 -0
- package/coverage/lcov-report/tar/lib/mkdir.js.html +686 -0
- package/coverage/lcov-report/tar/lib/pack.js.html +1268 -0
- package/coverage/lcov-report/tar/lib/parse.js.html +1310 -0
- package/coverage/lcov-report/tar/lib/pax.js.html +500 -0
- package/coverage/lcov-report/tar/lib/read-entry.js.html +347 -0
- package/coverage/lcov-report/tar/lib/replace.js.html +722 -0
- package/coverage/lcov-report/tar/lib/types.js.html +197 -0
- package/coverage/lcov-report/tar/lib/unpack.js.html +1604 -0
- package/coverage/lcov-report/tar/lib/update.js.html +173 -0
- package/coverage/lcov-report/tar/lib/warn-mixin.js.html +107 -0
- package/coverage/lcov-report/tar/lib/winchars.js.html +134 -0
- package/coverage/lcov-report/tar/lib/write-entry.js.html +1268 -0
- package/coverage/lcov.info +3690 -0
- package/lib/parse.js +6 -0
- package/package.json +2 -2
- package/test/link-file-entry-collision/bad-link.hex +25 -0
- package/test/link-file-entry-collision/bad-link.tar +0 -0
- package/test/link-file-entry-collision.js +39 -0
- package/.npmignore +0 -5
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Code coverage report for tar/lib/replace.js</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
7
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
<style type='text/css'>
|
|
10
|
+
.coverage-summary .sorter {
|
|
11
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div class='wrapper'>
|
|
17
|
+
<div class='pad1'>
|
|
18
|
+
<h1>
|
|
19
|
+
<a href="../../index.html">All files</a> / <a href="index.html">tar/lib</a> replace.js
|
|
20
|
+
</h1>
|
|
21
|
+
<div class='clearfix'>
|
|
22
|
+
<div class='fl pad1y space-right2'>
|
|
23
|
+
<span class="strong">100% </span>
|
|
24
|
+
<span class="quiet">Statements</span>
|
|
25
|
+
<span class='fraction'>131/131</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div class='fl pad1y space-right2'>
|
|
28
|
+
<span class="strong">100% </span>
|
|
29
|
+
<span class="quiet">Branches</span>
|
|
30
|
+
<span class='fraction'>70/70</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
|
+
<span class="quiet">Functions</span>
|
|
35
|
+
<span class='fraction'>18/18</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div class='fl pad1y space-right2'>
|
|
38
|
+
<span class="strong">100% </span>
|
|
39
|
+
<span class="quiet">Lines</span>
|
|
40
|
+
<span class='fraction'>128/128</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class='status-line high'></div>
|
|
45
|
+
<pre><table class="coverage">
|
|
46
|
+
<tr><td class="line-count quiet">1
|
|
47
|
+
2
|
|
48
|
+
3
|
|
49
|
+
4
|
|
50
|
+
5
|
|
51
|
+
6
|
|
52
|
+
7
|
|
53
|
+
8
|
|
54
|
+
9
|
|
55
|
+
10
|
|
56
|
+
11
|
|
57
|
+
12
|
|
58
|
+
13
|
|
59
|
+
14
|
|
60
|
+
15
|
|
61
|
+
16
|
|
62
|
+
17
|
|
63
|
+
18
|
|
64
|
+
19
|
|
65
|
+
20
|
|
66
|
+
21
|
|
67
|
+
22
|
|
68
|
+
23
|
|
69
|
+
24
|
|
70
|
+
25
|
|
71
|
+
26
|
|
72
|
+
27
|
|
73
|
+
28
|
|
74
|
+
29
|
|
75
|
+
30
|
|
76
|
+
31
|
|
77
|
+
32
|
|
78
|
+
33
|
|
79
|
+
34
|
|
80
|
+
35
|
|
81
|
+
36
|
|
82
|
+
37
|
|
83
|
+
38
|
|
84
|
+
39
|
|
85
|
+
40
|
|
86
|
+
41
|
|
87
|
+
42
|
|
88
|
+
43
|
|
89
|
+
44
|
|
90
|
+
45
|
|
91
|
+
46
|
|
92
|
+
47
|
|
93
|
+
48
|
|
94
|
+
49
|
|
95
|
+
50
|
|
96
|
+
51
|
|
97
|
+
52
|
|
98
|
+
53
|
|
99
|
+
54
|
|
100
|
+
55
|
|
101
|
+
56
|
|
102
|
+
57
|
|
103
|
+
58
|
|
104
|
+
59
|
|
105
|
+
60
|
|
106
|
+
61
|
|
107
|
+
62
|
|
108
|
+
63
|
|
109
|
+
64
|
|
110
|
+
65
|
|
111
|
+
66
|
|
112
|
+
67
|
|
113
|
+
68
|
|
114
|
+
69
|
|
115
|
+
70
|
|
116
|
+
71
|
|
117
|
+
72
|
|
118
|
+
73
|
|
119
|
+
74
|
|
120
|
+
75
|
|
121
|
+
76
|
|
122
|
+
77
|
|
123
|
+
78
|
|
124
|
+
79
|
|
125
|
+
80
|
|
126
|
+
81
|
|
127
|
+
82
|
|
128
|
+
83
|
|
129
|
+
84
|
|
130
|
+
85
|
|
131
|
+
86
|
|
132
|
+
87
|
|
133
|
+
88
|
|
134
|
+
89
|
|
135
|
+
90
|
|
136
|
+
91
|
|
137
|
+
92
|
|
138
|
+
93
|
|
139
|
+
94
|
|
140
|
+
95
|
|
141
|
+
96
|
|
142
|
+
97
|
|
143
|
+
98
|
|
144
|
+
99
|
|
145
|
+
100
|
|
146
|
+
101
|
|
147
|
+
102
|
|
148
|
+
103
|
|
149
|
+
104
|
|
150
|
+
105
|
|
151
|
+
106
|
|
152
|
+
107
|
|
153
|
+
108
|
|
154
|
+
109
|
|
155
|
+
110
|
|
156
|
+
111
|
|
157
|
+
112
|
|
158
|
+
113
|
|
159
|
+
114
|
|
160
|
+
115
|
|
161
|
+
116
|
|
162
|
+
117
|
|
163
|
+
118
|
|
164
|
+
119
|
|
165
|
+
120
|
|
166
|
+
121
|
|
167
|
+
122
|
|
168
|
+
123
|
|
169
|
+
124
|
|
170
|
+
125
|
|
171
|
+
126
|
|
172
|
+
127
|
|
173
|
+
128
|
|
174
|
+
129
|
|
175
|
+
130
|
|
176
|
+
131
|
|
177
|
+
132
|
|
178
|
+
133
|
|
179
|
+
134
|
|
180
|
+
135
|
|
181
|
+
136
|
|
182
|
+
137
|
|
183
|
+
138
|
|
184
|
+
139
|
|
185
|
+
140
|
|
186
|
+
141
|
|
187
|
+
142
|
|
188
|
+
143
|
|
189
|
+
144
|
|
190
|
+
145
|
|
191
|
+
146
|
|
192
|
+
147
|
|
193
|
+
148
|
|
194
|
+
149
|
|
195
|
+
150
|
|
196
|
+
151
|
|
197
|
+
152
|
|
198
|
+
153
|
|
199
|
+
154
|
|
200
|
+
155
|
|
201
|
+
156
|
|
202
|
+
157
|
|
203
|
+
158
|
|
204
|
+
159
|
|
205
|
+
160
|
|
206
|
+
161
|
|
207
|
+
162
|
|
208
|
+
163
|
|
209
|
+
164
|
|
210
|
+
165
|
|
211
|
+
166
|
|
212
|
+
167
|
|
213
|
+
168
|
|
214
|
+
169
|
|
215
|
+
170
|
|
216
|
+
171
|
|
217
|
+
172
|
|
218
|
+
173
|
|
219
|
+
174
|
|
220
|
+
175
|
|
221
|
+
176
|
|
222
|
+
177
|
|
223
|
+
178
|
|
224
|
+
179
|
|
225
|
+
180
|
|
226
|
+
181
|
|
227
|
+
182
|
|
228
|
+
183
|
|
229
|
+
184
|
|
230
|
+
185
|
|
231
|
+
186
|
|
232
|
+
187
|
|
233
|
+
188
|
|
234
|
+
189
|
|
235
|
+
190
|
|
236
|
+
191
|
|
237
|
+
192
|
|
238
|
+
193
|
|
239
|
+
194
|
|
240
|
+
195
|
|
241
|
+
196
|
|
242
|
+
197
|
|
243
|
+
198
|
|
244
|
+
199
|
|
245
|
+
200
|
|
246
|
+
201
|
|
247
|
+
202
|
|
248
|
+
203
|
|
249
|
+
204
|
|
250
|
+
205
|
|
251
|
+
206
|
|
252
|
+
207
|
|
253
|
+
208
|
|
254
|
+
209
|
|
255
|
+
210
|
|
256
|
+
211
|
|
257
|
+
212
|
|
258
|
+
213
|
|
259
|
+
214
|
|
260
|
+
215
|
|
261
|
+
216
|
|
262
|
+
217
|
|
263
|
+
218
|
|
264
|
+
219
|
|
265
|
+
220</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
266
|
+
<span class="cline-any cline-neutral"> </span>
|
|
267
|
+
<span class="cline-any cline-neutral"> </span>
|
|
268
|
+
<span class="cline-any cline-yes">3x</span>
|
|
269
|
+
<span class="cline-any cline-yes">3x</span>
|
|
270
|
+
<span class="cline-any cline-yes">3x</span>
|
|
271
|
+
<span class="cline-any cline-yes">3x</span>
|
|
272
|
+
<span class="cline-any cline-yes">3x</span>
|
|
273
|
+
<span class="cline-any cline-yes">3x</span>
|
|
274
|
+
<span class="cline-any cline-yes">3x</span>
|
|
275
|
+
<span class="cline-any cline-neutral"> </span>
|
|
276
|
+
<span class="cline-any cline-neutral"> </span>
|
|
277
|
+
<span class="cline-any cline-neutral"> </span>
|
|
278
|
+
<span class="cline-any cline-neutral"> </span>
|
|
279
|
+
<span class="cline-any cline-neutral"> </span>
|
|
280
|
+
<span class="cline-any cline-neutral"> </span>
|
|
281
|
+
<span class="cline-any cline-neutral"> </span>
|
|
282
|
+
<span class="cline-any cline-yes">3x</span>
|
|
283
|
+
<span class="cline-any cline-neutral"> </span>
|
|
284
|
+
<span class="cline-any cline-yes">3x</span>
|
|
285
|
+
<span class="cline-any cline-yes">70x</span>
|
|
286
|
+
<span class="cline-any cline-neutral"> </span>
|
|
287
|
+
<span class="cline-any cline-yes">70x</span>
|
|
288
|
+
<span class="cline-any cline-yes">1x</span>
|
|
289
|
+
<span class="cline-any cline-neutral"> </span>
|
|
290
|
+
<span class="cline-any cline-yes">69x</span>
|
|
291
|
+
<span class="cline-any cline-yes">1x</span>
|
|
292
|
+
<span class="cline-any cline-neutral"> </span>
|
|
293
|
+
<span class="cline-any cline-yes">68x</span>
|
|
294
|
+
<span class="cline-any cline-yes">1x</span>
|
|
295
|
+
<span class="cline-any cline-neutral"> </span>
|
|
296
|
+
<span class="cline-any cline-yes">67x</span>
|
|
297
|
+
<span class="cline-any cline-neutral"> </span>
|
|
298
|
+
<span class="cline-any cline-yes">67x</span>
|
|
299
|
+
<span class="cline-any cline-neutral"> </span>
|
|
300
|
+
<span class="cline-any cline-neutral"> </span>
|
|
301
|
+
<span class="cline-any cline-neutral"> </span>
|
|
302
|
+
<span class="cline-any cline-yes">3x</span>
|
|
303
|
+
<span class="cline-any cline-yes">26x</span>
|
|
304
|
+
<span class="cline-any cline-neutral"> </span>
|
|
305
|
+
<span class="cline-any cline-yes">26x</span>
|
|
306
|
+
<span class="cline-any cline-neutral"> </span>
|
|
307
|
+
<span class="cline-any cline-neutral"> </span>
|
|
308
|
+
<span class="cline-any cline-neutral"> </span>
|
|
309
|
+
<span class="cline-any cline-yes">26x</span>
|
|
310
|
+
<span class="cline-any cline-yes">26x</span>
|
|
311
|
+
<span class="cline-any cline-yes">26x</span>
|
|
312
|
+
<span class="cline-any cline-neutral"> </span>
|
|
313
|
+
<span class="cline-any cline-yes">4x</span>
|
|
314
|
+
<span class="cline-any cline-yes">2x</span>
|
|
315
|
+
<span class="cline-any cline-neutral"> </span>
|
|
316
|
+
<span class="cline-any cline-yes">2x</span>
|
|
317
|
+
<span class="cline-any cline-neutral"> </span>
|
|
318
|
+
<span class="cline-any cline-neutral"> </span>
|
|
319
|
+
<span class="cline-any cline-yes">24x</span>
|
|
320
|
+
<span class="cline-any cline-yes">22x</span>
|
|
321
|
+
<span class="cline-any cline-neutral"> </span>
|
|
322
|
+
<span class="cline-any cline-yes">22x</span>
|
|
323
|
+
<span class="cline-any cline-yes">61x</span>
|
|
324
|
+
<span class="cline-any cline-yes">63x</span>
|
|
325
|
+
<span class="cline-any cline-neutral"> </span>
|
|
326
|
+
<span class="cline-any cline-neutral"> </span>
|
|
327
|
+
<span class="cline-any cline-neutral"> </span>
|
|
328
|
+
<span class="cline-any cline-yes">61x</span>
|
|
329
|
+
<span class="cline-any cline-yes">2x</span>
|
|
330
|
+
<span class="cline-any cline-neutral"> </span>
|
|
331
|
+
<span class="cline-any cline-yes">59x</span>
|
|
332
|
+
<span class="cline-any cline-yes">2x</span>
|
|
333
|
+
<span class="cline-any cline-neutral"> </span>
|
|
334
|
+
<span class="cline-any cline-neutral"> </span>
|
|
335
|
+
<span class="cline-any cline-yes">55x</span>
|
|
336
|
+
<span class="cline-any cline-yes">55x</span>
|
|
337
|
+
<span class="cline-any cline-yes">8x</span>
|
|
338
|
+
<span class="cline-any cline-yes">47x</span>
|
|
339
|
+
<span class="cline-any cline-yes">47x</span>
|
|
340
|
+
<span class="cline-any cline-yes">2x</span>
|
|
341
|
+
<span class="cline-any cline-neutral"> </span>
|
|
342
|
+
<span class="cline-any cline-neutral"> </span>
|
|
343
|
+
<span class="cline-any cline-yes">45x</span>
|
|
344
|
+
<span class="cline-any cline-yes">45x</span>
|
|
345
|
+
<span class="cline-any cline-yes">28x</span>
|
|
346
|
+
<span class="cline-any cline-neutral"> </span>
|
|
347
|
+
<span class="cline-any cline-yes">18x</span>
|
|
348
|
+
<span class="cline-any cline-neutral"> </span>
|
|
349
|
+
<span class="cline-any cline-yes">18x</span>
|
|
350
|
+
<span class="cline-any cline-neutral"> </span>
|
|
351
|
+
<span class="cline-any cline-yes">26x</span>
|
|
352
|
+
<span class="cline-any cline-yes">8x</span>
|
|
353
|
+
<span class="cline-any cline-neutral"> </span>
|
|
354
|
+
<span class="cline-any cline-neutral"> </span>
|
|
355
|
+
<span class="cline-any cline-neutral"> </span>
|
|
356
|
+
<span class="cline-any cline-yes">3x</span>
|
|
357
|
+
<span class="cline-any cline-yes">18x</span>
|
|
358
|
+
<span class="cline-any cline-neutral"> </span>
|
|
359
|
+
<span class="cline-any cline-neutral"> </span>
|
|
360
|
+
<span class="cline-any cline-neutral"> </span>
|
|
361
|
+
<span class="cline-any cline-yes">18x</span>
|
|
362
|
+
<span class="cline-any cline-yes">18x</span>
|
|
363
|
+
<span class="cline-any cline-neutral"> </span>
|
|
364
|
+
<span class="cline-any cline-neutral"> </span>
|
|
365
|
+
<span class="cline-any cline-yes">3x</span>
|
|
366
|
+
<span class="cline-any cline-yes">41x</span>
|
|
367
|
+
<span class="cline-any cline-yes">41x</span>
|
|
368
|
+
<span class="cline-any cline-neutral"> </span>
|
|
369
|
+
<span class="cline-any cline-yes">41x</span>
|
|
370
|
+
<span class="cline-any cline-yes">37x</span>
|
|
371
|
+
<span class="cline-any cline-yes">37x</span>
|
|
372
|
+
<span class="cline-any cline-yes">4x</span>
|
|
373
|
+
<span class="cline-any cline-neutral"> </span>
|
|
374
|
+
<span class="cline-any cline-yes">33x</span>
|
|
375
|
+
<span class="cline-any cline-neutral"> </span>
|
|
376
|
+
<span class="cline-any cline-neutral"> </span>
|
|
377
|
+
<span class="cline-any cline-yes">37x</span>
|
|
378
|
+
<span class="cline-any cline-yes">37x</span>
|
|
379
|
+
<span class="cline-any cline-yes">8x</span>
|
|
380
|
+
<span class="cline-any cline-neutral"> </span>
|
|
381
|
+
<span class="cline-any cline-yes">29x</span>
|
|
382
|
+
<span class="cline-any cline-yes">29x</span>
|
|
383
|
+
<span class="cline-any cline-yes">29x</span>
|
|
384
|
+
<span class="cline-any cline-yes">112x</span>
|
|
385
|
+
<span class="cline-any cline-yes">2x</span>
|
|
386
|
+
<span class="cline-any cline-yes">110x</span>
|
|
387
|
+
<span class="cline-any cline-yes">110x</span>
|
|
388
|
+
<span class="cline-any cline-yes">6x</span>
|
|
389
|
+
<span class="cline-any cline-neutral"> </span>
|
|
390
|
+
<span class="cline-any cline-neutral"> </span>
|
|
391
|
+
<span class="cline-any cline-neutral"> </span>
|
|
392
|
+
<span class="cline-any cline-neutral"> </span>
|
|
393
|
+
<span class="cline-any cline-yes">104x</span>
|
|
394
|
+
<span class="cline-any cline-yes">2x</span>
|
|
395
|
+
<span class="cline-any cline-neutral"> </span>
|
|
396
|
+
<span class="cline-any cline-neutral"> </span>
|
|
397
|
+
<span class="cline-any cline-yes">102x</span>
|
|
398
|
+
<span class="cline-any cline-yes">4x</span>
|
|
399
|
+
<span class="cline-any cline-neutral"> </span>
|
|
400
|
+
<span class="cline-any cline-yes">98x</span>
|
|
401
|
+
<span class="cline-any cline-yes">98x</span>
|
|
402
|
+
<span class="cline-any cline-yes">13x</span>
|
|
403
|
+
<span class="cline-any cline-neutral"> </span>
|
|
404
|
+
<span class="cline-any cline-yes">85x</span>
|
|
405
|
+
<span class="cline-any cline-yes">85x</span>
|
|
406
|
+
<span class="cline-any cline-yes">4x</span>
|
|
407
|
+
<span class="cline-any cline-neutral"> </span>
|
|
408
|
+
<span class="cline-any cline-yes">81x</span>
|
|
409
|
+
<span class="cline-any cline-yes">81x</span>
|
|
410
|
+
<span class="cline-any cline-yes">4x</span>
|
|
411
|
+
<span class="cline-any cline-neutral"> </span>
|
|
412
|
+
<span class="cline-any cline-yes">77x</span>
|
|
413
|
+
<span class="cline-any cline-yes">46x</span>
|
|
414
|
+
<span class="cline-any cline-yes">77x</span>
|
|
415
|
+
<span class="cline-any cline-yes">77x</span>
|
|
416
|
+
<span class="cline-any cline-neutral"> </span>
|
|
417
|
+
<span class="cline-any cline-yes">29x</span>
|
|
418
|
+
<span class="cline-any cline-neutral"> </span>
|
|
419
|
+
<span class="cline-any cline-neutral"> </span>
|
|
420
|
+
<span class="cline-any cline-yes">41x</span>
|
|
421
|
+
<span class="cline-any cline-yes">41x</span>
|
|
422
|
+
<span class="cline-any cline-yes">41x</span>
|
|
423
|
+
<span class="cline-any cline-yes">41x</span>
|
|
424
|
+
<span class="cline-any cline-yes">45x</span>
|
|
425
|
+
<span class="cline-any cline-yes">4x</span>
|
|
426
|
+
<span class="cline-any cline-yes">4x</span>
|
|
427
|
+
<span class="cline-any cline-neutral"> </span>
|
|
428
|
+
<span class="cline-any cline-neutral"> </span>
|
|
429
|
+
<span class="cline-any cline-yes">41x</span>
|
|
430
|
+
<span class="cline-any cline-yes">2x</span>
|
|
431
|
+
<span class="cline-any cline-neutral"> </span>
|
|
432
|
+
<span class="cline-any cline-yes">39x</span>
|
|
433
|
+
<span class="cline-any cline-yes">39x</span>
|
|
434
|
+
<span class="cline-any cline-yes">2x</span>
|
|
435
|
+
<span class="cline-any cline-yes">37x</span>
|
|
436
|
+
<span class="cline-any cline-yes">37x</span>
|
|
437
|
+
<span class="cline-any cline-yes">4x</span>
|
|
438
|
+
<span class="cline-any cline-yes">33x</span>
|
|
439
|
+
<span class="cline-any cline-neutral"> </span>
|
|
440
|
+
<span class="cline-any cline-neutral"> </span>
|
|
441
|
+
<span class="cline-any cline-neutral"> </span>
|
|
442
|
+
<span class="cline-any cline-yes">33x</span>
|
|
443
|
+
<span class="cline-any cline-yes">33x</span>
|
|
444
|
+
<span class="cline-any cline-yes">33x</span>
|
|
445
|
+
<span class="cline-any cline-yes">33x</span>
|
|
446
|
+
<span class="cline-any cline-neutral"> </span>
|
|
447
|
+
<span class="cline-any cline-neutral"> </span>
|
|
448
|
+
<span class="cline-any cline-neutral"> </span>
|
|
449
|
+
<span class="cline-any cline-yes">41x</span>
|
|
450
|
+
<span class="cline-any cline-neutral"> </span>
|
|
451
|
+
<span class="cline-any cline-neutral"> </span>
|
|
452
|
+
<span class="cline-any cline-yes">41x</span>
|
|
453
|
+
<span class="cline-any cline-neutral"> </span>
|
|
454
|
+
<span class="cline-any cline-neutral"> </span>
|
|
455
|
+
<span class="cline-any cline-yes">3x</span>
|
|
456
|
+
<span class="cline-any cline-yes">18x</span>
|
|
457
|
+
<span class="cline-any cline-yes">19x</span>
|
|
458
|
+
<span class="cline-any cline-yes">1x</span>
|
|
459
|
+
<span class="cline-any cline-neutral"> </span>
|
|
460
|
+
<span class="cline-any cline-neutral"> </span>
|
|
461
|
+
<span class="cline-any cline-neutral"> </span>
|
|
462
|
+
<span class="cline-any cline-yes">3x</span>
|
|
463
|
+
<span class="cline-any cline-neutral"> </span>
|
|
464
|
+
<span class="cline-any cline-neutral"> </span>
|
|
465
|
+
<span class="cline-any cline-yes">18x</span>
|
|
466
|
+
<span class="cline-any cline-neutral"> </span>
|
|
467
|
+
<span class="cline-any cline-yes">18x</span>
|
|
468
|
+
<span class="cline-any cline-neutral"> </span>
|
|
469
|
+
<span class="cline-any cline-neutral"> </span>
|
|
470
|
+
<span class="cline-any cline-yes">3x</span>
|
|
471
|
+
<span class="cline-any cline-yes">34x</span>
|
|
472
|
+
<span class="cline-any cline-yes">33x</span>
|
|
473
|
+
<span class="cline-any cline-yes">33x</span>
|
|
474
|
+
<span class="cline-any cline-yes">1x</span>
|
|
475
|
+
<span class="cline-any cline-neutral"> </span>
|
|
476
|
+
<span class="cline-any cline-neutral"> </span>
|
|
477
|
+
<span class="cline-any cline-yes">3x</span>
|
|
478
|
+
<span class="cline-any cline-yes">1x</span>
|
|
479
|
+
<span class="cline-any cline-neutral"> </span>
|
|
480
|
+
<span class="cline-any cline-yes">32x</span>
|
|
481
|
+
<span class="cline-any cline-neutral"> </span>
|
|
482
|
+
<span class="cline-any cline-yes">33x</span>
|
|
483
|
+
<span class="cline-any cline-neutral"> </span>
|
|
484
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict'
|
|
485
|
+
|
|
486
|
+
// tar -r
|
|
487
|
+
const hlo = require('./high-level-opt.js')
|
|
488
|
+
const Pack = require('./pack.js')
|
|
489
|
+
const Parse = require('./parse.js')
|
|
490
|
+
const fs = require('fs')
|
|
491
|
+
const fsm = require('fs-minipass')
|
|
492
|
+
const t = require('./list.js')
|
|
493
|
+
const path = require('path')
|
|
494
|
+
|
|
495
|
+
// starting at the head of the file, read a Header
|
|
496
|
+
// If the checksum is invalid, that's our position to start writing
|
|
497
|
+
// If it is, jump forward by the specified size (round up to 512)
|
|
498
|
+
// and try again.
|
|
499
|
+
// Write the new Pack stream starting there.
|
|
500
|
+
|
|
501
|
+
const Header = require('./header.js')
|
|
502
|
+
|
|
503
|
+
const r = module.exports = (opt_, files, cb) => {
|
|
504
|
+
const opt = hlo(opt_)
|
|
505
|
+
|
|
506
|
+
if (!opt.file)
|
|
507
|
+
throw new TypeError('file is required')
|
|
508
|
+
|
|
509
|
+
if (opt.gzip)
|
|
510
|
+
throw new TypeError('cannot append to compressed archives')
|
|
511
|
+
|
|
512
|
+
if (!files || !Array.isArray(files) || !files.length)
|
|
513
|
+
throw new TypeError('no files or directories specified')
|
|
514
|
+
|
|
515
|
+
files = Array.from(files)
|
|
516
|
+
|
|
517
|
+
return opt.sync ? replaceSync(opt, files)
|
|
518
|
+
: replace(opt, files, cb)
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
const replaceSync = (opt, files) => {
|
|
522
|
+
const p = new Pack.Sync(opt)
|
|
523
|
+
|
|
524
|
+
let threw = true
|
|
525
|
+
let fd
|
|
526
|
+
let position
|
|
527
|
+
|
|
528
|
+
try {
|
|
529
|
+
try {
|
|
530
|
+
fd = fs.openSync(opt.file, 'r+')
|
|
531
|
+
} catch (er) {
|
|
532
|
+
if (er.code === 'ENOENT')
|
|
533
|
+
fd = fs.openSync(opt.file, 'w+')
|
|
534
|
+
else
|
|
535
|
+
throw er
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const st = fs.fstatSync(fd)
|
|
539
|
+
const headBuf = Buffer.alloc(512)
|
|
540
|
+
|
|
541
|
+
POSITION: for (position = 0; position < st.size; position += 512) {
|
|
542
|
+
for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {
|
|
543
|
+
bytes = fs.readSync(
|
|
544
|
+
fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos
|
|
545
|
+
)
|
|
546
|
+
|
|
547
|
+
if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)
|
|
548
|
+
throw new Error('cannot append to compressed archives')
|
|
549
|
+
|
|
550
|
+
if (!bytes)
|
|
551
|
+
break POSITION
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
let h = new Header(headBuf)
|
|
555
|
+
if (!h.cksumValid)
|
|
556
|
+
break
|
|
557
|
+
let entryBlockSize = 512 * Math.ceil(h.size / 512)
|
|
558
|
+
if (position + entryBlockSize + 512 > st.size)
|
|
559
|
+
break
|
|
560
|
+
// the 512 for the header we just parsed will be added as well
|
|
561
|
+
// also jump ahead all the blocks for the body
|
|
562
|
+
position += entryBlockSize
|
|
563
|
+
if (opt.mtimeCache)
|
|
564
|
+
opt.mtimeCache.set(h.path, h.mtime)
|
|
565
|
+
}
|
|
566
|
+
threw = false
|
|
567
|
+
|
|
568
|
+
streamSync(opt, p, position, fd, files)
|
|
569
|
+
} finally {
|
|
570
|
+
if (threw)
|
|
571
|
+
try { fs.closeSync(fd) } catch (er) {}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const streamSync = (opt, p, position, fd, files) => {
|
|
576
|
+
const stream = new fsm.WriteStreamSync(opt.file, {
|
|
577
|
+
fd: fd,
|
|
578
|
+
start: position
|
|
579
|
+
})
|
|
580
|
+
p.pipe(stream)
|
|
581
|
+
addFilesSync(p, files)
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const replace = (opt, files, cb) => {
|
|
585
|
+
files = Array.from(files)
|
|
586
|
+
const p = new Pack(opt)
|
|
587
|
+
|
|
588
|
+
const getPos = (fd, size, cb_) => {
|
|
589
|
+
const cb = (er, pos) => {
|
|
590
|
+
if (er)
|
|
591
|
+
fs.close(fd, _ => cb_(er))
|
|
592
|
+
else
|
|
593
|
+
cb_(null, pos)
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
let position = 0
|
|
597
|
+
if (size === 0)
|
|
598
|
+
return cb(null, 0)
|
|
599
|
+
|
|
600
|
+
let bufPos = 0
|
|
601
|
+
const headBuf = Buffer.alloc(512)
|
|
602
|
+
const onread = (er, bytes) => {
|
|
603
|
+
if (er)
|
|
604
|
+
return cb(er)
|
|
605
|
+
bufPos += bytes
|
|
606
|
+
if (bufPos < 512 && bytes)
|
|
607
|
+
return fs.read(
|
|
608
|
+
fd, headBuf, bufPos, headBuf.length - bufPos,
|
|
609
|
+
position + bufPos, onread
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)
|
|
613
|
+
return cb(new Error('cannot append to compressed archives'))
|
|
614
|
+
|
|
615
|
+
// truncated header
|
|
616
|
+
if (bufPos < 512)
|
|
617
|
+
return cb(null, position)
|
|
618
|
+
|
|
619
|
+
const h = new Header(headBuf)
|
|
620
|
+
if (!h.cksumValid)
|
|
621
|
+
return cb(null, position)
|
|
622
|
+
|
|
623
|
+
const entryBlockSize = 512 * Math.ceil(h.size / 512)
|
|
624
|
+
if (position + entryBlockSize + 512 > size)
|
|
625
|
+
return cb(null, position)
|
|
626
|
+
|
|
627
|
+
position += entryBlockSize + 512
|
|
628
|
+
if (position >= size)
|
|
629
|
+
return cb(null, position)
|
|
630
|
+
|
|
631
|
+
if (opt.mtimeCache)
|
|
632
|
+
opt.mtimeCache.set(h.path, h.mtime)
|
|
633
|
+
bufPos = 0
|
|
634
|
+
fs.read(fd, headBuf, 0, 512, position, onread)
|
|
635
|
+
}
|
|
636
|
+
fs.read(fd, headBuf, 0, 512, position, onread)
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
const promise = new Promise((resolve, reject) => {
|
|
640
|
+
p.on('error', reject)
|
|
641
|
+
let flag = 'r+'
|
|
642
|
+
const onopen = (er, fd) => {
|
|
643
|
+
if (er && er.code === 'ENOENT' && flag === 'r+') {
|
|
644
|
+
flag = 'w+'
|
|
645
|
+
return fs.open(opt.file, flag, onopen)
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (er)
|
|
649
|
+
return reject(er)
|
|
650
|
+
|
|
651
|
+
fs.fstat(fd, (er, st) => {
|
|
652
|
+
if (er)
|
|
653
|
+
return reject(er)
|
|
654
|
+
getPos(fd, st.size, (er, position) => {
|
|
655
|
+
if (er)
|
|
656
|
+
return reject(er)
|
|
657
|
+
const stream = new fsm.WriteStream(opt.file, {
|
|
658
|
+
fd: fd,
|
|
659
|
+
start: position
|
|
660
|
+
})
|
|
661
|
+
p.pipe(stream)
|
|
662
|
+
stream.on('error', reject)
|
|
663
|
+
stream.on('close', resolve)
|
|
664
|
+
addFilesAsync(p, files)
|
|
665
|
+
})
|
|
666
|
+
})
|
|
667
|
+
}
|
|
668
|
+
fs.open(opt.file, flag, onopen)
|
|
669
|
+
})
|
|
670
|
+
|
|
671
|
+
return cb ? promise.then(cb, cb) : promise
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
const addFilesSync = (p, files) => {
|
|
675
|
+
files.forEach(file => {
|
|
676
|
+
if (file.charAt(0) === '@')
|
|
677
|
+
t({
|
|
678
|
+
file: path.resolve(p.cwd, file.substr(1)),
|
|
679
|
+
sync: true,
|
|
680
|
+
noResume: true,
|
|
681
|
+
onentry: entry => p.add(entry)
|
|
682
|
+
})
|
|
683
|
+
else
|
|
684
|
+
p.add(file)
|
|
685
|
+
})
|
|
686
|
+
p.end()
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const addFilesAsync = (p, files) => {
|
|
690
|
+
while (files.length) {
|
|
691
|
+
const file = files.shift()
|
|
692
|
+
if (file.charAt(0) === '@')
|
|
693
|
+
return t({
|
|
694
|
+
file: path.resolve(p.cwd, file.substr(1)),
|
|
695
|
+
noResume: true,
|
|
696
|
+
onentry: entry => p.add(entry)
|
|
697
|
+
}).then(_ => addFilesAsync(p, files))
|
|
698
|
+
else
|
|
699
|
+
p.add(file)
|
|
700
|
+
}
|
|
701
|
+
p.end()
|
|
702
|
+
}
|
|
703
|
+
</pre></td></tr>
|
|
704
|
+
</table></pre>
|
|
705
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
706
|
+
</div><!-- /wrapper -->
|
|
707
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
708
|
+
Code coverage
|
|
709
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Nov 20 2017 16:00:38 GMT-0800 (PST)
|
|
710
|
+
</div>
|
|
711
|
+
</div>
|
|
712
|
+
<script src="../../prettify.js"></script>
|
|
713
|
+
<script>
|
|
714
|
+
window.onload = function () {
|
|
715
|
+
if (typeof prettyPrint === 'function') {
|
|
716
|
+
prettyPrint();
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
</script>
|
|
720
|
+
<script src="../../sorter.js"></script>
|
|
721
|
+
</body>
|
|
722
|
+
</html>
|