@ac-kit/format-zip 0.2.0 → 0.3.0

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 (47) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +77 -19
  3. package/dist/_producer-stream.d.ts +14 -0
  4. package/dist/_producer-stream.d.ts.map +1 -0
  5. package/dist/_producer-stream.js +80 -0
  6. package/dist/_producer-stream.js.map +1 -0
  7. package/dist/_zip-directory.d.ts +97 -0
  8. package/dist/_zip-directory.d.ts.map +1 -0
  9. package/dist/_zip-directory.js +541 -0
  10. package/dist/_zip-directory.js.map +1 -0
  11. package/dist/_zip-entries.d.ts +31 -0
  12. package/dist/_zip-entries.d.ts.map +1 -0
  13. package/dist/_zip-entries.js +192 -0
  14. package/dist/_zip-entries.js.map +1 -0
  15. package/dist/_zip-format.d.ts +33 -0
  16. package/dist/_zip-format.d.ts.map +1 -1
  17. package/dist/_zip-format.js +33 -0
  18. package/dist/_zip-format.js.map +1 -1
  19. package/dist/_zip-headers.d.ts +49 -0
  20. package/dist/_zip-headers.d.ts.map +1 -0
  21. package/dist/_zip-headers.js +158 -0
  22. package/dist/_zip-headers.js.map +1 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/zip-archive.d.ts +41 -1
  28. package/dist/zip-archive.d.ts.map +1 -1
  29. package/dist/zip-archive.js +14 -197
  30. package/dist/zip-archive.js.map +1 -1
  31. package/dist/zip-error.d.ts +3 -2
  32. package/dist/zip-error.d.ts.map +1 -1
  33. package/dist/zip-error.js +3 -2
  34. package/dist/zip-error.js.map +1 -1
  35. package/dist/zip-source.d.ts +59 -0
  36. package/dist/zip-source.d.ts.map +1 -0
  37. package/dist/zip-source.js +149 -0
  38. package/dist/zip-source.js.map +1 -0
  39. package/dist/zip-stream-writer.d.ts +61 -0
  40. package/dist/zip-stream-writer.d.ts.map +1 -0
  41. package/dist/zip-stream-writer.js +419 -0
  42. package/dist/zip-stream-writer.js.map +1 -0
  43. package/dist/zip-writer.d.ts +52 -21
  44. package/dist/zip-writer.d.ts.map +1 -1
  45. package/dist/zip-writer.js +18 -206
  46. package/dist/zip-writer.js.map +1 -1
  47. package/package.json +6 -4
@@ -0,0 +1,541 @@
1
+ import { bigIntIsSafeNumber, concatBytes, decodeText, getBigUint64Le, getUint32Le, UnsupportedError, } from "@ac-kit/core";
2
+ import { crc_32 } from "@ac-kit/noncrypto-hash";
3
+ import { CENTRAL_HEADER_, CENTRAL_HEADER_SIZE_, ENCRYPTED_FLAG_, END_OF_CENTRAL_DIRECTORY_, END_OF_CENTRAL_DIRECTORY_SIZE_, LOCAL_HEADER_, LOCAL_HEADER_SIZE_, MAX_COMMENT_, SATURATED_UINT16_, SATURATED_UINT32_, UNICODE_PATH_EXTRA_, UTF8_FLAG_, ZIP64_END_LOCATOR_, ZIP64_END_LOCATOR_SIZE_, ZIP64_END_OF_CENTRAL_DIRECTORY_, ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_, ZIP64_EXTRA_, } from "./_zip-format.js";
4
+ import { ZipFormatError, ZipLimitError } from "./zip-error.js";
5
+ /** APPNOTE §4.3.13 central directory digital signature. */
6
+ const DIGITAL_SIGNATURE_ = 0x05054b50;
7
+ const DIGITAL_SIGNATURE_SIZE_ = 6;
8
+ // The parsing openZip and openZipSource share. Every function takes a window
9
+ // of the archive and the archive offset it starts at, so errors report archive
10
+ // positions whichever way the bytes were fetched.
11
+ /**
12
+ * Most bytes from the end of an archive that hold its end records: the classic
13
+ * record with the longest comment, the ZIP64 locator and a version 1 ZIP64
14
+ * record.
15
+ */
16
+ export const MAX_TAIL_ = END_OF_CENTRAL_DIRECTORY_SIZE_ +
17
+ MAX_COMMENT_ +
18
+ ZIP64_END_LOCATOR_SIZE_ +
19
+ ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_;
20
+ function u16_(bytes, offset) {
21
+ return getUint32Le(bytes, offset, 2);
22
+ }
23
+ function u64_(bytes, offset, position) {
24
+ const value = getBigUint64Le(bytes, offset);
25
+ if (!bigIntIsSafeNumber(value)) {
26
+ throw new ZipFormatError("Size past what this reader can address", position);
27
+ }
28
+ return Number(value);
29
+ }
30
+ /**
31
+ * Most distinct directories (offset and entry count) and most ZIP64 end records
32
+ * outside the tail that the end records may name before the archive is refused
33
+ * as ambiguous. Each distinct directory is parsed once and each record read
34
+ * once, so this bounds the work to a few directory parses and reads whatever
35
+ * forged records an archive comment holds. It is safe: such a candidate passed
36
+ * the exact fit and layout checks, and a legitimate archive has one directory
37
+ * (with a ZIP64 record, a classic record may defer to it or state it), plus at
38
+ * most a record forged in its comment; two valid candidates are already refused
39
+ * as ambiguous.
40
+ */
41
+ const MAX_CANDIDATE_DIRECTORIES_ = 4;
42
+ /**
43
+ * Finds and reads the central directory of an archive of `archiveSize` bytes
44
+ * whose last bytes are `tail`, yielding each further read it needs (a ZIP64 end
45
+ * record, the directory) and receiving its bytes, so a synchronous and an
46
+ * asynchronous caller share it.
47
+ *
48
+ * Candidates sharing a directory offset and entry count parse their headers
49
+ * once, then check their own declared extent and trailer. Groups are checked by
50
+ * decreasing directory end to reuse overlapping reads. Errors and ambiguity are
51
+ * still reported in end-record order. If the byte limit precludes fetching a
52
+ * directory for validation, the reader fails closed, as it does past
53
+ * {@link MAX_CANDIDATE_DIRECTORIES_} directories or ZIP64 records to fetch.
54
+ *
55
+ * @throws {ZipFormatError} When no candidate is valid (the error of the
56
+ * earliest candidate), multiple are valid and the earliest valid one is
57
+ * within limits, or the end records name too many directories.
58
+ * @throws {ZipLimitError} When the earliest valid candidate exceeds a limit or
59
+ * the byte limit prevents selecting a directory.
60
+ * @throws {UnsupportedError} When the earliest candidate spans several disks.
61
+ */
62
+ export function* readArchiveDirectory_(tail, archiveSize, limits) {
63
+ const tailOffset = archiveSize - tail.length;
64
+ const groups = new Map();
65
+ const zip64Records = new Map();
66
+ let unverified = null;
67
+ let failure = null;
68
+ let failureOffset = Infinity;
69
+ let zip64Reads = 0;
70
+ let overflow = null;
71
+ const tooMany = (offset) => new ZipFormatError("Ambiguous archive: too many end of central directory records", tailOffset + offset);
72
+ const recordFailure = (error, offset) => {
73
+ if (!(error instanceof ZipFormatError ||
74
+ error instanceof UnsupportedError ||
75
+ error instanceof ZipLimitError)) {
76
+ throw error;
77
+ }
78
+ if (offset < failureOffset) {
79
+ failure = error;
80
+ failureOffset = offset;
81
+ }
82
+ };
83
+ for (let offset = tail.length - END_OF_CENTRAL_DIRECTORY_SIZE_; offset >=
84
+ Math.max(0, tail.length - END_OF_CENTRAL_DIRECTORY_SIZE_ - MAX_COMMENT_); offset--) {
85
+ if (getUint32Le(tail, offset) !== END_OF_CENTRAL_DIRECTORY_ ||
86
+ offset + END_OF_CENTRAL_DIRECTORY_SIZE_ + u16_(tail, offset + 20) !==
87
+ tail.length) {
88
+ continue;
89
+ }
90
+ try {
91
+ const end = readEndCandidate_(tail, offset, tailOffset);
92
+ let location = end;
93
+ const recordOffset = end.zip64RecordOffset;
94
+ if (recordOffset !== null) {
95
+ let record = zip64Records.get(recordOffset);
96
+ if (record === undefined) {
97
+ if (recordOffset < tailOffset &&
98
+ ++zip64Reads > MAX_CANDIDATE_DIRECTORIES_) {
99
+ overflow = tooMany(offset);
100
+ break;
101
+ }
102
+ record =
103
+ recordOffset >= tailOffset
104
+ ? tail.subarray(recordOffset - tailOffset, recordOffset -
105
+ tailOffset +
106
+ ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_)
107
+ : yield {
108
+ offset: recordOffset,
109
+ length: ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_,
110
+ };
111
+ zip64Records.set(recordOffset, record);
112
+ }
113
+ location = readZip64EndRecord_(record, recordOffset, end.zip64LocatorOffset);
114
+ }
115
+ const { count, directorySize, directoryOffset } = location;
116
+ if (directorySize > archiveSize - directoryOffset ||
117
+ count > Math.floor(directorySize / CENTRAL_HEADER_SIZE_)) {
118
+ throw new ZipFormatError("Truncated central directory", directoryOffset);
119
+ }
120
+ let beyondLimit = null;
121
+ if (count > limits.maxEntries) {
122
+ beyondLimit = new ZipLimitError(`The archive lists ${count} entries, more than ${limits.maxEntries}`);
123
+ }
124
+ if (limits.maxDirectorySize !== undefined &&
125
+ directorySize > limits.maxDirectorySize) {
126
+ beyondLimit ??= new ZipLimitError(`The central directory holds ${directorySize} bytes, more than ${limits.maxDirectorySize}`);
127
+ if (directoryOffset < tailOffset) {
128
+ unverified = beyondLimit;
129
+ recordFailure(beyondLimit, offset);
130
+ continue;
131
+ }
132
+ }
133
+ const key = `${directoryOffset}:${count}`;
134
+ const candidate = {
135
+ count,
136
+ directorySize,
137
+ directoryOffset,
138
+ endOffset: offset,
139
+ limit: beyondLimit,
140
+ };
141
+ const group = groups.get(key);
142
+ if (group === undefined) {
143
+ if (groups.size === MAX_CANDIDATE_DIRECTORIES_) {
144
+ overflow = tooMany(offset);
145
+ break;
146
+ }
147
+ groups.set(key, [candidate]);
148
+ }
149
+ else {
150
+ group.push(candidate);
151
+ }
152
+ }
153
+ catch (error) {
154
+ recordFailure(error, offset);
155
+ }
156
+ }
157
+ if (overflow !== null) {
158
+ throw overflow;
159
+ }
160
+ const orderedGroups = Array.from(groups.values(), (candidates) => {
161
+ const largest = candidates.reduce((largest, candidate) => candidate.directorySize > largest.directorySize ? candidate : largest);
162
+ return {
163
+ candidates,
164
+ largest,
165
+ end: largest.directoryOffset + largest.directorySize,
166
+ };
167
+ }).sort((first, second) => second.end - first.end);
168
+ let window = tail;
169
+ let windowOffset = tailOffset;
170
+ let found = null;
171
+ let foundEntries = [];
172
+ let secondOffset = -1;
173
+ let latestOffset = -1;
174
+ for (const { candidates, largest, end } of orderedGroups) {
175
+ const { directoryOffset, count } = largest;
176
+ let bytes;
177
+ if (largest.directorySize === 0) {
178
+ bytes = tail.subarray(0, 0);
179
+ }
180
+ else if (directoryOffset >= tailOffset) {
181
+ bytes = tail.subarray(directoryOffset - tailOffset, end - tailOffset);
182
+ }
183
+ else {
184
+ // Future ends can only move left. Keep the cached left edge when it
185
+ // already covers the request; otherwise fetch only the missing prefix.
186
+ if (directoryOffset < windowOffset) {
187
+ const prefix = yield {
188
+ offset: directoryOffset,
189
+ length: Math.min(end, windowOffset) - directoryOffset,
190
+ };
191
+ window =
192
+ end <= windowOffset
193
+ ? prefix
194
+ : concatBytes(prefix, window.subarray(0, end - windowOffset));
195
+ windowOffset = directoryOffset;
196
+ }
197
+ bytes = window.subarray(directoryOffset - windowOffset, end - windowOffset);
198
+ }
199
+ const headers = readCentralHeaders_(bytes, directoryOffset, count, candidates.some((candidate) => candidate.limit === null));
200
+ for (const candidate of candidates) {
201
+ const { endOffset, directorySize } = candidate;
202
+ try {
203
+ if (headers.length > directorySize) {
204
+ throw new ZipFormatError("Truncated central directory header", directoryOffset + directorySize);
205
+ }
206
+ if ("error" in headers) {
207
+ throw headers.error;
208
+ }
209
+ checkDirectoryTrailer_(bytes.subarray(0, directorySize), directoryOffset, count, headers.length);
210
+ }
211
+ catch (error) {
212
+ recordFailure(error, endOffset);
213
+ continue;
214
+ }
215
+ if (endOffset > latestOffset) {
216
+ secondOffset = latestOffset;
217
+ latestOffset = endOffset;
218
+ }
219
+ else {
220
+ secondOffset = Math.max(secondOffset, endOffset);
221
+ }
222
+ if (found === null || endOffset < found.endOffset) {
223
+ found = candidate;
224
+ foundEntries = candidate.limit === null ? headers.entries : [];
225
+ }
226
+ }
227
+ }
228
+ if (found !== null) {
229
+ if (found.limit !== null) {
230
+ throw found.limit;
231
+ }
232
+ if (secondOffset !== -1) {
233
+ throw new ZipFormatError("Ambiguous archive: two valid end of central directory records", tailOffset + secondOffset);
234
+ }
235
+ if (unverified !== null) {
236
+ throw unverified;
237
+ }
238
+ return {
239
+ comment: readComment_(tail, found.endOffset),
240
+ entries: foundEntries,
241
+ directoryOffset: found.directoryOffset,
242
+ };
243
+ }
244
+ throw (failure ?? new ZipFormatError("No end of central directory", archiveSize));
245
+ }
246
+ /**
247
+ * The end of central directory record at `end` in `tail` (which starts at
248
+ * archive offset `tailOffset`), and the ZIP64 locator before it when the
249
+ * classic layout does not hold: the central directory ends where the record
250
+ * starts, or a ZIP64 locator before it points before itself. A count of exactly
251
+ * 65 535 without a locator is taken literally when the classic layout holds.
252
+ * Disk fields are 0, or the 0xFFFF sentinel where ZIP64 applies.
253
+ *
254
+ * @throws {ZipFormatError} When the layout it states does not hold.
255
+ * @throws {UnsupportedError} When it states several disks.
256
+ */
257
+ export function readEndCandidate_(tail, end, tailOffset) {
258
+ const disk = u16_(tail, end + 4);
259
+ const directoryDisk = u16_(tail, end + 6);
260
+ const diskCount = u16_(tail, end + 8);
261
+ const count = u16_(tail, end + 10);
262
+ const directorySize = getUint32Le(tail, end + 12);
263
+ const directoryOffset = getUint32Le(tail, end + 16);
264
+ const endOffset = tailOffset + end;
265
+ const locator = end - ZIP64_END_LOCATOR_SIZE_;
266
+ const isClassic = count !== SATURATED_UINT16_ &&
267
+ directorySize !== SATURATED_UINT32_ &&
268
+ directoryOffset !== SATURATED_UINT32_ &&
269
+ directoryOffset + directorySize === endOffset;
270
+ // Some writers (Python's zipfile) add ZIP64 records with unsaturated classic
271
+ // fields: the locator is followed whenever the classic layout does not hold.
272
+ if (!isClassic &&
273
+ locator >= 0 &&
274
+ getUint32Le(tail, locator) === ZIP64_END_LOCATOR_) {
275
+ const isDiskField = (value) => value === 0 || value === SATURATED_UINT16_;
276
+ if (!isDiskField(disk) ||
277
+ !isDiskField(directoryDisk) ||
278
+ (diskCount !== count && diskCount !== SATURATED_UINT16_) ||
279
+ getUint32Le(tail, locator + 4) !== 0 ||
280
+ getUint32Le(tail, locator + 16) > 1) {
281
+ throw new UnsupportedError("ZIP archive split across disks");
282
+ }
283
+ const recordOffset = getBigUint64Le(tail, locator + 8);
284
+ const locatorOffset = tailOffset + locator;
285
+ if (recordOffset + BigInt(ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_) >
286
+ BigInt(locatorOffset)) {
287
+ throw new ZipFormatError("A ZIP64 locator pointing past itself", locatorOffset);
288
+ }
289
+ return {
290
+ get comment() {
291
+ return readComment_(tail, end);
292
+ },
293
+ count,
294
+ directorySize,
295
+ directoryOffset,
296
+ zip64RecordOffset: Number(recordOffset),
297
+ zip64LocatorOffset: locatorOffset,
298
+ };
299
+ }
300
+ if (disk !== 0 || directoryDisk !== 0 || diskCount !== count) {
301
+ throw new UnsupportedError("ZIP archive split across disks");
302
+ }
303
+ if (directorySize === SATURATED_UINT32_ ||
304
+ directoryOffset === SATURATED_UINT32_ ||
305
+ directoryOffset + directorySize !== endOffset) {
306
+ throw new ZipFormatError("An end of central directory that does not follow its directory", endOffset);
307
+ }
308
+ return {
309
+ get comment() {
310
+ return readComment_(tail, end);
311
+ },
312
+ count,
313
+ directorySize,
314
+ directoryOffset,
315
+ zip64RecordOffset: null,
316
+ zip64LocatorOffset: null,
317
+ };
318
+ }
319
+ /** Decodes the chosen EOCD's comment, not all overlapping candidate comments. */
320
+ function readComment_(tail, end) {
321
+ return decodeText(tail.subarray(end + END_OF_CENTRAL_DIRECTORY_SIZE_), "ibm437");
322
+ }
323
+ /**
324
+ * Reads the ZIP64 end of central directory record in `record` (its first 56
325
+ * bytes at least), which starts at archive offset `recordOffset`, the locator
326
+ * being at `locatorOffset`. The record may carry an extensible data sector, as
327
+ * long as it ends exactly at the locator; the directory must end where it
328
+ * starts.
329
+ *
330
+ * @throws {ZipFormatError} When it is truncated, has another signature, or
331
+ * contradicts the layout.
332
+ * @throws {UnsupportedError} When it states several disks.
333
+ */
334
+ export function readZip64EndRecord_(record, recordOffset, locatorOffset) {
335
+ if (record.length < ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_) {
336
+ throw new ZipFormatError("Truncated ZIP64 end of central directory", recordOffset);
337
+ }
338
+ if (getUint32Le(record, 0) !== ZIP64_END_OF_CENTRAL_DIRECTORY_) {
339
+ throw new ZipFormatError("Missing ZIP64 end of central directory", recordOffset);
340
+ }
341
+ const recordSize = getBigUint64Le(record, 4);
342
+ if (recordSize < BigInt(ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_ - 12) ||
343
+ BigInt(recordOffset) + 12n + recordSize !== BigInt(locatorOffset)) {
344
+ throw new ZipFormatError("A ZIP64 end of central directory that does not reach its locator", recordOffset);
345
+ }
346
+ const count = u64_(record, 32, recordOffset);
347
+ if (getUint32Le(record, 16) !== 0 ||
348
+ getUint32Le(record, 20) !== 0 ||
349
+ u64_(record, 24, recordOffset) !== count) {
350
+ throw new UnsupportedError("ZIP archive split across disks");
351
+ }
352
+ const directorySize = u64_(record, 40, recordOffset);
353
+ const directoryOffset = u64_(record, 48, recordOffset);
354
+ if (directoryOffset + directorySize !== recordOffset) {
355
+ throw new ZipFormatError("A central directory that does not end at the ZIP64 end record", recordOffset);
356
+ }
357
+ return { count, directorySize, directoryOffset };
358
+ }
359
+ /**
360
+ * Reads `count` central headers from `directory`, which starts at archive
361
+ * offset `directoryOffset`, then validates any trailing records. Linear in the
362
+ * directory's size.
363
+ *
364
+ * @throws {ZipFormatError} When a header is truncated, has another signature,
365
+ * holds a broken ZIP64 field or UTF-8 name, or leaves unrecognized bytes.
366
+ */
367
+ export function readCentralDirectory_(directory, directoryOffset, count) {
368
+ const headers = readCentralHeaders_(directory, directoryOffset, count, true);
369
+ if ("error" in headers) {
370
+ throw headers.error;
371
+ }
372
+ checkDirectoryTrailer_(directory, directoryOffset, count, headers.length);
373
+ return headers.entries;
374
+ }
375
+ /**
376
+ * Parses the shared header prefix and reports how far its result depends on the
377
+ * bytes.
378
+ */
379
+ function readCentralHeaders_(directory, directoryOffset, count, collectEntries) {
380
+ const entries = [];
381
+ let offset = 0;
382
+ let requiredLength = 0;
383
+ try {
384
+ for (let index = 0; index < count; index++) {
385
+ const position = directoryOffset + offset;
386
+ if (offset + CENTRAL_HEADER_SIZE_ > directory.length) {
387
+ throw new ZipFormatError("Truncated central directory header", position);
388
+ }
389
+ requiredLength = offset + CENTRAL_HEADER_SIZE_;
390
+ if (getUint32Le(directory, offset) !== CENTRAL_HEADER_) {
391
+ throw new ZipFormatError("Expected a central directory header", position);
392
+ }
393
+ const flags = u16_(directory, offset + 8);
394
+ const nameLength = u16_(directory, offset + 28);
395
+ const extraLength = u16_(directory, offset + 30);
396
+ const commentLength = u16_(directory, offset + 32);
397
+ const nameStart = offset + CENTRAL_HEADER_SIZE_;
398
+ const extraStart = nameStart + nameLength;
399
+ const commentStart = extraStart + extraLength;
400
+ const next = commentStart + commentLength;
401
+ if (next > directory.length) {
402
+ throw new ZipFormatError("Truncated central directory header", position);
403
+ }
404
+ requiredLength = next;
405
+ const nameBytes = directory.subarray(nameStart, extraStart);
406
+ const extra = directory.subarray(extraStart, commentStart);
407
+ let compressedSize = getUint32Le(directory, offset + 20);
408
+ let size = getUint32Le(directory, offset + 24);
409
+ let localOffset = getUint32Le(directory, offset + 42);
410
+ let disk = u16_(directory, offset + 34);
411
+ let unicodeName = null;
412
+ for (let field = 0; field + 4 <= extra.length;) {
413
+ const id = u16_(extra, field);
414
+ const length = u16_(extra, field + 2);
415
+ const data = extra.subarray(field + 4, field + 4 + length);
416
+ if (id === ZIP64_EXTRA_) {
417
+ // Only the fields whose header value is saturated are present, in order.
418
+ let cursor = 0;
419
+ const read = () => {
420
+ if (cursor + 8 > data.length) {
421
+ throw new ZipFormatError("Truncated ZIP64 field", position);
422
+ }
423
+ const value = u64_(data, cursor, position);
424
+ cursor += 8;
425
+ return value;
426
+ };
427
+ size = size === SATURATED_UINT32_ ? read() : size;
428
+ compressedSize =
429
+ compressedSize === SATURATED_UINT32_ ? read() : compressedSize;
430
+ localOffset =
431
+ localOffset === SATURATED_UINT32_ ? read() : localOffset;
432
+ if (disk === SATURATED_UINT16_) {
433
+ if (cursor + 4 > data.length) {
434
+ throw new ZipFormatError("Truncated ZIP64 field", position);
435
+ }
436
+ disk = getUint32Le(data, cursor);
437
+ }
438
+ }
439
+ else if (id === UNICODE_PATH_EXTRA_ &&
440
+ data[0] === 1 &&
441
+ data.length >= 5 &&
442
+ getUint32Le(data, 1) === crc_32(nameBytes)) {
443
+ unicodeName = decodeUtf8_(data.subarray(5), position);
444
+ }
445
+ field += 4 + length;
446
+ }
447
+ if (disk !== 0) {
448
+ throw new UnsupportedError("ZIP archive split across disks");
449
+ }
450
+ const isUtf8 = (flags & UTF8_FLAG_) !== 0;
451
+ const utf8Name = isUtf8 ? decodeUtf8_(nameBytes, position) : unicodeName;
452
+ if (!collectEntries) {
453
+ offset = next;
454
+ continue;
455
+ }
456
+ const name = utf8Name ?? decodeText(nameBytes, "ibm437");
457
+ const time = u16_(directory, offset + 12);
458
+ const date = u16_(directory, offset + 14);
459
+ entries.push({
460
+ name,
461
+ isDirectory: name.endsWith("/"),
462
+ method: u16_(directory, offset + 10),
463
+ compressedSize,
464
+ size,
465
+ crc32: getUint32Le(directory, offset + 16),
466
+ lastModified: new Date(1980 + (date >> 9), ((date >> 5) & 0x0f) - 1, date & 0x1f, time >> 11, (time >> 5) & 0x3f, (time & 0x1f) * 2),
467
+ comment: decodeText(directory.subarray(commentStart, next), isUtf8 ? "utf-8" : "ibm437", { ignoreBOM: true }),
468
+ isEncrypted: (flags & ENCRYPTED_FLAG_) !== 0,
469
+ offset: localOffset,
470
+ });
471
+ offset = next;
472
+ }
473
+ }
474
+ catch (error) {
475
+ if (error instanceof ZipFormatError || error instanceof UnsupportedError) {
476
+ return { error, length: requiredLength };
477
+ }
478
+ throw error;
479
+ }
480
+ return { entries, length: offset };
481
+ }
482
+ /**
483
+ * Validates the optional signature and ZIP64 end records in a directory's
484
+ * declared extent.
485
+ */
486
+ function checkDirectoryTrailer_(directory, directoryOffset, count, start) {
487
+ let offset = start;
488
+ if (directory.length - offset >= DIGITAL_SIGNATURE_SIZE_ &&
489
+ getUint32Le(directory, offset) === DIGITAL_SIGNATURE_) {
490
+ const length = u16_(directory, offset + 4);
491
+ offset += DIGITAL_SIGNATURE_SIZE_ + length;
492
+ if (offset > directory.length) {
493
+ throw new ZipFormatError("Truncated central directory digital signature", directoryOffset + start);
494
+ }
495
+ }
496
+ if (offset === directory.length) {
497
+ return;
498
+ }
499
+ const position = directoryOffset + offset;
500
+ const locator = directory.length - ZIP64_END_LOCATOR_SIZE_;
501
+ if (locator - offset >= ZIP64_END_OF_CENTRAL_DIRECTORY_SIZE_ &&
502
+ getUint32Le(directory, offset) === ZIP64_END_OF_CENTRAL_DIRECTORY_ &&
503
+ getBigUint64Le(directory, offset + 4) + 12n === BigInt(locator - offset) &&
504
+ getUint32Le(directory, locator) === ZIP64_END_LOCATOR_ &&
505
+ getBigUint64Le(directory, locator + 8) === BigInt(position)) {
506
+ const location = readZip64EndRecord_(directory.subarray(offset, locator), position, directoryOffset + locator);
507
+ if (getUint32Le(directory, locator + 4) !== 0 ||
508
+ getUint32Le(directory, locator + 16) > 1) {
509
+ throw new UnsupportedError("ZIP archive split across disks");
510
+ }
511
+ if (location.count === count &&
512
+ location.directoryOffset === directoryOffset) {
513
+ return;
514
+ }
515
+ }
516
+ throw new ZipFormatError("Unexpected trailing central directory bytes", position);
517
+ }
518
+ /**
519
+ * The archive offset of an entry's data, after the local header in `header`
520
+ * (its first 30 bytes) at archive offset `headerOffset` and the name and extra
521
+ * field whose lengths it states.
522
+ *
523
+ * @throws {ZipFormatError} When it is truncated or has another signature.
524
+ */
525
+ export function readLocalHeader_(header, headerOffset) {
526
+ if (header.length < LOCAL_HEADER_SIZE_ ||
527
+ getUint32Le(header, 0) !== LOCAL_HEADER_) {
528
+ throw new ZipFormatError("Expected a local header", headerOffset);
529
+ }
530
+ return (headerOffset + LOCAL_HEADER_SIZE_ + u16_(header, 26) + u16_(header, 28));
531
+ }
532
+ function decodeUtf8_(bytes, offset) {
533
+ try {
534
+ // A leading U+FEFF is part of the name, not a byte order mark.
535
+ return decodeText(bytes, "utf-8", { fatal: true, ignoreBOM: true });
536
+ }
537
+ catch {
538
+ throw new ZipFormatError("A UTF-8 name that is not UTF-8", offset);
539
+ }
540
+ }
541
+ //# sourceMappingURL=_zip-directory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_zip-directory.js","sourceRoot":"","sources":["../src/_zip-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACX,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EACN,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,8BAA8B,EAC9B,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,+BAA+B,EAC/B,oCAAoC,EACpC,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/D,2DAA2D;AAC3D,MAAM,kBAAkB,GAAG,UAAU,CAAC;AACtC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,6EAA6E;AAC7E,+EAA+E;AAC/E,kDAAkD;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GACrB,8BAA8B;IAC9B,YAAY;IACZ,uBAAuB;IACvB,oCAAoC,CAAC;AAkBtC,SAAS,IAAI,CAAC,KAAiB,EAAE,MAAc;IAC9C,OAAO,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,IAAI,CAAC,KAAiB,EAAE,MAAc,EAAE,QAAgB;IAChE,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC5C,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,cAAc,CACvB,wCAAwC,EACxC,QAAQ,CACR,CAAC;IACH,CAAC;IACD,OAAO,MAA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archive.js";
2
+ /**
3
+ * Byte ranges of an archive, however it is held. Both functions fail with
4
+ * {@link ZipFormatError} rather than return fewer bytes than asked.
5
+ */
6
+ export type ZipRanges_ = {
7
+ readonly size: number;
8
+ read(offset: number, length: number, signal: AbortSignal | undefined): Promise<Uint8Array>;
9
+ stream(offset: number, length: number, signal: AbortSignal): ReadableStream<Uint8Array<ArrayBuffer>>;
10
+ /** Whether `error` came from the source itself, not from inflating. */
11
+ isSourceError(error: unknown): boolean;
12
+ };
13
+ /**
14
+ * Copies `chunk` into an `ArrayBuffer` of its own when it is backed by another
15
+ * kind of buffer, so callers get the type Web APIs take.
16
+ */
17
+ export declare function ownBuffer_(chunk: Uint8Array): Uint8Array<ArrayBuffer>;
18
+ /**
19
+ * The {@link ZipArchive} over `entries`, whose content is read from `ranges`.
20
+ * The data offset of each entry, read from its local header, is cached, so a
21
+ * ranged source pays that read once per entry; memory stays O(entries).
22
+ *
23
+ * Each entry's local header and data must lie before the next entry's local
24
+ * header, or before the central directory at `directoryOffset` for the last: an
25
+ * entry overlapping another (two names over the same data, a bomb's usual
26
+ * trick) or the directory is refused when read.
27
+ */
28
+ export declare function createArchive_(entries: readonly ZipEntry[], comment: string, ranges: ZipRanges_, limits: ZipLimits, directoryOffset: number): ZipArchive;
29
+ /** The ranges of an archive held in memory. */
30
+ export declare function bytesRanges_(bytes: Uint8Array<ArrayBuffer>): ZipRanges_;
31
+ //# sourceMappingURL=_zip-entries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_zip-entries.d.ts","sourceRoot":"","sources":["../src/_zip-entries.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIxE;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,IAAI,CACH,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,GAAG,SAAS,GAC7B,OAAO,CAAC,UAAU,CAAC,CAAC;IACvB,MAAM,CACL,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,GACjB,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3C,uEAAuE;IACvE,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,CAIrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC7B,OAAO,EAAE,SAAS,QAAQ,EAAE,EAC5B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,MAAM,GACrB,UAAU,CAgGZ;AA6GD,+CAA+C;AAC/C,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,UAAU,CAsBvE"}