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.
Files changed (59) hide show
  1. package/.nyc_output/0471d9cf-687f-4ae8-84a5-ce7468becd03.json +1 -0
  2. package/.nyc_output/12bca2bc-6a2b-4f45-abc7-8483922a524d.json +1 -0
  3. package/.nyc_output/37d58de4-deea-4808-bb77-d27685bd1501.json +1 -0
  4. package/.nyc_output/5ad8066b-6b8c-4bc8-b807-c40bf80898b7.json +1 -0
  5. package/.nyc_output/5cbf674c-7089-4b7d-b9de-2119be4dbb0b.json +1 -0
  6. package/.nyc_output/7853e29b-78ef-4ab4-b8fb-e1e176c0787b.json +1 -0
  7. package/.nyc_output/9d414044-b18d-4f6d-b2e0-531a89bf6f4f.json +1 -0
  8. package/.nyc_output/c3ffeb8c-8e79-4a2c-b678-e5a917fe721e.json +1 -0
  9. package/.nyc_output/ea0194cb-f599-402f-8876-84fb8251e8db.json +1 -0
  10. package/.nyc_output/eda6b7a3-5e15-440f-8619-e11a15a07f77.json +1 -0
  11. package/.nyc_output/fb518800-240c-42ff-811f-79e92708d9db.json +1 -0
  12. package/.nyc_output/fdecfc06-a944-4897-9530-e08f62883fc1.json +1 -0
  13. package/.nyc_output/processinfo/0471d9cf-687f-4ae8-84a5-ce7468becd03.json +1 -0
  14. package/.nyc_output/processinfo/12bca2bc-6a2b-4f45-abc7-8483922a524d.json +1 -0
  15. package/.nyc_output/processinfo/37d58de4-deea-4808-bb77-d27685bd1501.json +1 -0
  16. package/.nyc_output/processinfo/5ad8066b-6b8c-4bc8-b807-c40bf80898b7.json +1 -0
  17. package/.nyc_output/processinfo/5cbf674c-7089-4b7d-b9de-2119be4dbb0b.json +1 -0
  18. package/.nyc_output/processinfo/7853e29b-78ef-4ab4-b8fb-e1e176c0787b.json +1 -0
  19. package/.nyc_output/processinfo/9d414044-b18d-4f6d-b2e0-531a89bf6f4f.json +1 -0
  20. package/.nyc_output/processinfo/c3ffeb8c-8e79-4a2c-b678-e5a917fe721e.json +1 -0
  21. package/.nyc_output/processinfo/ea0194cb-f599-402f-8876-84fb8251e8db.json +1 -0
  22. package/.nyc_output/processinfo/eda6b7a3-5e15-440f-8619-e11a15a07f77.json +1 -0
  23. package/.nyc_output/processinfo/fb518800-240c-42ff-811f-79e92708d9db.json +1 -0
  24. package/.nyc_output/processinfo/fdecfc06-a944-4897-9530-e08f62883fc1.json +1 -0
  25. package/.nyc_output/processinfo/index.json +1 -0
  26. package/coverage/lcov-report/base.css +212 -0
  27. package/coverage/lcov-report/index.html +106 -0
  28. package/coverage/lcov-report/prettify.css +1 -0
  29. package/coverage/lcov-report/prettify.js +1 -0
  30. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  31. package/coverage/lcov-report/sorter.js +158 -0
  32. package/coverage/lcov-report/tar/index.html +93 -0
  33. package/coverage/lcov-report/tar/index.js.html +119 -0
  34. package/coverage/lcov-report/tar/lib/create.js.html +380 -0
  35. package/coverage/lcov-report/tar/lib/extract.js.html +401 -0
  36. package/coverage/lcov-report/tar/lib/header.js.html +881 -0
  37. package/coverage/lcov-report/tar/lib/high-level-opt.js.html +152 -0
  38. package/coverage/lcov-report/tar/lib/index.html +314 -0
  39. package/coverage/lcov-report/tar/lib/large-numbers.js.html +341 -0
  40. package/coverage/lcov-report/tar/lib/list.js.html +449 -0
  41. package/coverage/lcov-report/tar/lib/mkdir.js.html +686 -0
  42. package/coverage/lcov-report/tar/lib/pack.js.html +1268 -0
  43. package/coverage/lcov-report/tar/lib/parse.js.html +1310 -0
  44. package/coverage/lcov-report/tar/lib/pax.js.html +500 -0
  45. package/coverage/lcov-report/tar/lib/read-entry.js.html +347 -0
  46. package/coverage/lcov-report/tar/lib/replace.js.html +722 -0
  47. package/coverage/lcov-report/tar/lib/types.js.html +197 -0
  48. package/coverage/lcov-report/tar/lib/unpack.js.html +1604 -0
  49. package/coverage/lcov-report/tar/lib/update.js.html +173 -0
  50. package/coverage/lcov-report/tar/lib/warn-mixin.js.html +107 -0
  51. package/coverage/lcov-report/tar/lib/winchars.js.html +134 -0
  52. package/coverage/lcov-report/tar/lib/write-entry.js.html +1268 -0
  53. package/coverage/lcov.info +3690 -0
  54. package/lib/parse.js +6 -0
  55. package/package.json +2 -2
  56. package/test/link-file-entry-collision/bad-link.hex +25 -0
  57. package/test/link-file-entry-collision/bad-link.tar +0 -0
  58. package/test/link-file-entry-collision.js +39 -0
  59. package/.npmignore +0 -5
@@ -0,0 +1,341 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Code coverage report for tar/lib/large-numbers.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> large-numbers.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'>59/59</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'>20/20</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'>8/8</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'>57/57</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</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
139
+ <span class="cline-any cline-neutral">&nbsp;</span>
140
+ <span class="cline-any cline-neutral">&nbsp;</span>
141
+ <span class="cline-any cline-neutral">&nbsp;</span>
142
+ <span class="cline-any cline-neutral">&nbsp;</span>
143
+ <span class="cline-any cline-neutral">&nbsp;</span>
144
+ <span class="cline-any cline-yes">14x</span>
145
+ <span class="cline-any cline-yes">17x</span>
146
+ <span class="cline-any cline-yes">17x</span>
147
+ <span class="cline-any cline-yes">6x</span>
148
+ <span class="cline-any cline-neutral">&nbsp;</span>
149
+ <span class="cline-any cline-yes">11x</span>
150
+ <span class="cline-any cline-yes">17x</span>
151
+ <span class="cline-any cline-neutral">&nbsp;</span>
152
+ <span class="cline-any cline-neutral">&nbsp;</span>
153
+ <span class="cline-any cline-yes">14x</span>
154
+ <span class="cline-any cline-yes">11x</span>
155
+ <span class="cline-any cline-yes">11x</span>
156
+ <span class="cline-any cline-yes">86x</span>
157
+ <span class="cline-any cline-yes">31x</span>
158
+ <span class="cline-any cline-neutral">&nbsp;</span>
159
+ <span class="cline-any cline-yes">55x</span>
160
+ <span class="cline-any cline-yes">55x</span>
161
+ <span class="cline-any cline-neutral">&nbsp;</span>
162
+ <span class="cline-any cline-neutral">&nbsp;</span>
163
+ <span class="cline-any cline-neutral">&nbsp;</span>
164
+ <span class="cline-any cline-neutral">&nbsp;</span>
165
+ <span class="cline-any cline-yes">14x</span>
166
+ <span class="cline-any cline-yes">6x</span>
167
+ <span class="cline-any cline-yes">6x</span>
168
+ <span class="cline-any cline-yes">6x</span>
169
+ <span class="cline-any cline-yes">6x</span>
170
+ <span class="cline-any cline-neutral">&nbsp;</span>
171
+ <span class="cline-any cline-yes">60x</span>
172
+ <span class="cline-any cline-yes">42x</span>
173
+ <span class="cline-any cline-neutral">&nbsp;</span>
174
+ <span class="cline-any cline-yes">18x</span>
175
+ <span class="cline-any cline-yes">18x</span>
176
+ <span class="cline-any cline-neutral">&nbsp;</span>
177
+ <span class="cline-any cline-yes">60x</span>
178
+ <span class="cline-any cline-yes">48x</span>
179
+ <span class="cline-any cline-yes">12x</span>
180
+ <span class="cline-any cline-yes">6x</span>
181
+ <span class="cline-any cline-neutral">&nbsp;</span>
182
+ <span class="cline-any cline-yes">6x</span>
183
+ <span class="cline-any cline-yes">6x</span>
184
+ <span class="cline-any cline-neutral">&nbsp;</span>
185
+ <span class="cline-any cline-neutral">&nbsp;</span>
186
+ <span class="cline-any cline-neutral">&nbsp;</span>
187
+ <span class="cline-any cline-neutral">&nbsp;</span>
188
+ <span class="cline-any cline-yes">14x</span>
189
+ <span class="cline-any cline-yes">47x</span>
190
+ <span class="cline-any cline-yes">47x</span>
191
+ <span class="cline-any cline-yes">47x</span>
192
+ <span class="cline-any cline-neutral">&nbsp;</span>
193
+ <span class="cline-any cline-neutral">&nbsp;</span>
194
+ <span class="cline-any cline-neutral">&nbsp;</span>
195
+ <span class="cline-any cline-yes">14x</span>
196
+ <span class="cline-any cline-yes">6x</span>
197
+ <span class="cline-any cline-yes">6x</span>
198
+ <span class="cline-any cline-yes">6x</span>
199
+ <span class="cline-any cline-yes">6x</span>
200
+ <span class="cline-any cline-yes">60x</span>
201
+ <span class="cline-any cline-neutral">&nbsp;</span>
202
+ <span class="cline-any cline-yes">60x</span>
203
+ <span class="cline-any cline-yes">48x</span>
204
+ <span class="cline-any cline-yes">12x</span>
205
+ <span class="cline-any cline-yes">6x</span>
206
+ <span class="cline-any cline-neutral">&nbsp;</span>
207
+ <span class="cline-any cline-yes">6x</span>
208
+ <span class="cline-any cline-yes">6x</span>
209
+ <span class="cline-any cline-neutral">&nbsp;</span>
210
+ <span class="cline-any cline-yes">60x</span>
211
+ <span class="cline-any cline-yes">12x</span>
212
+ <span class="cline-any cline-neutral">&nbsp;</span>
213
+ <span class="cline-any cline-yes">6x</span>
214
+ <span class="cline-any cline-neutral">&nbsp;</span>
215
+ <span class="cline-any cline-neutral">&nbsp;</span>
216
+ <span class="cline-any cline-yes">14x</span>
217
+ <span class="cline-any cline-yes">41x</span>
218
+ <span class="cline-any cline-yes">41x</span>
219
+ <span class="cline-any cline-yes">41x</span>
220
+ <span class="cline-any cline-yes">266x</span>
221
+ <span class="cline-any cline-yes">266x</span>
222
+ <span class="cline-any cline-yes">161x</span>
223
+ <span class="cline-any cline-neutral">&nbsp;</span>
224
+ <span class="cline-any cline-yes">41x</span>
225
+ <span class="cline-any cline-neutral">&nbsp;</span>
226
+ <span class="cline-any cline-neutral">&nbsp;</span>
227
+ <span class="cline-any cline-yes">96x</span>
228
+ <span class="cline-any cline-neutral">&nbsp;</span>
229
+ <span class="cline-any cline-yes">14x</span>
230
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict'
231
+ // Tar can encode large and negative numbers using a leading byte of
232
+ // 0xff for negative, and 0x80 for positive. The trailing byte in the
233
+ // section will always be 0x20, or in some implementations 0x00.
234
+ // this module encodes and decodes these things.
235
+ &nbsp;
236
+ const encode = exports.encode = (num, buf) =&gt; {
237
+ buf[buf.length - 1] = 0x20
238
+ if (num &lt; 0)
239
+ encodeNegative(num, buf)
240
+ else
241
+ encodePositive(num, buf)
242
+ return buf
243
+ }
244
+ &nbsp;
245
+ const encodePositive = (num, buf) =&gt; {
246
+ buf[0] = 0x80
247
+ for (var i = buf.length - 2; i &gt; 0; i--) {
248
+ if (num === 0)
249
+ buf[i] = 0
250
+ else {
251
+ buf[i] = num % 0x100
252
+ num = Math.floor(num / 0x100)
253
+ }
254
+ }
255
+ }
256
+ &nbsp;
257
+ const encodeNegative = (num, buf) =&gt; {
258
+ buf[0] = 0xff
259
+ var flipped = false
260
+ num = num * -1
261
+ for (var i = buf.length - 2; i &gt; 0; i--) {
262
+ var byte
263
+ if (num === 0)
264
+ byte = 0
265
+ else {
266
+ byte = num % 0x100
267
+ num = Math.floor(num / 0x100)
268
+ }
269
+ if (flipped)
270
+ buf[i] = onesComp(byte)
271
+ else if (byte === 0)
272
+ buf[i] = 0
273
+ else {
274
+ flipped = true
275
+ buf[i] = twosComp(byte)
276
+ }
277
+ }
278
+ }
279
+ &nbsp;
280
+ const parse = exports.parse = (buf) =&gt; {
281
+ var post = buf[buf.length - 1]
282
+ var pre = buf[0]
283
+ return pre === 0x80 ? pos(buf.slice(1, buf.length - 1))
284
+ : twos(buf.slice(1, buf.length - 1))
285
+ }
286
+ &nbsp;
287
+ const twos = (buf) =&gt; {
288
+ var len = buf.length
289
+ var sum = 0
290
+ var flipped = false
291
+ for (var i = len - 1; i &gt; -1; i--) {
292
+ var byte = buf[i]
293
+ var f
294
+ if (flipped)
295
+ f = onesComp(byte)
296
+ else if (byte === 0)
297
+ f = byte
298
+ else {
299
+ flipped = true
300
+ f = twosComp(byte)
301
+ }
302
+ if (f !== 0)
303
+ sum += f * Math.pow(256, len - i - 1)
304
+ }
305
+ return sum * -1
306
+ }
307
+ &nbsp;
308
+ const pos = (buf) =&gt; {
309
+ var len = buf.length
310
+ var sum = 0
311
+ for (var i = len - 1; i &gt; -1; i--) {
312
+ var byte = buf[i]
313
+ if (byte !== 0)
314
+ sum += byte * Math.pow(256, len - i - 1)
315
+ }
316
+ return sum
317
+ }
318
+ &nbsp;
319
+ const onesComp = byte =&gt; (0xff ^ byte) &amp; 0xff
320
+ &nbsp;
321
+ const twosComp = byte =&gt; ((0xff ^ byte) + 1) &amp; 0xff
322
+ &nbsp;</pre></td></tr>
323
+ </table></pre>
324
+ <div class='push'></div><!-- for sticky footer -->
325
+ </div><!-- /wrapper -->
326
+ <div class='footer quiet pad2 space-top1 center small'>
327
+ Code coverage
328
+ generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Nov 20 2017 16:00:38 GMT-0800 (PST)
329
+ </div>
330
+ </div>
331
+ <script src="../../prettify.js"></script>
332
+ <script>
333
+ window.onload = function () {
334
+ if (typeof prettyPrint === 'function') {
335
+ prettyPrint();
336
+ }
337
+ };
338
+ </script>
339
+ <script src="../../sorter.js"></script>
340
+ </body>
341
+ </html>