@zip.js/zip.js 2.7.64 → 2.7.66
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/deno.json +1 -1
- package/dist/z-worker-fflate.js +1 -1
- package/dist/z-worker-pako.js +1 -1
- package/dist/z-worker.js +1 -1
- package/dist/zip-fs-full.js +256 -208
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +258 -210
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +252 -208
- package/dist/zip-full.min.js +1 -1
- package/dist/zip-no-worker-deflate.min.js +1 -1
- package/dist/zip-no-worker-inflate.min.js +1 -1
- package/dist/zip-no-worker.min.js +1 -1
- package/dist/zip.js +252 -208
- package/dist/zip.min.js +1 -1
- package/index.cjs +256 -208
- package/index.d.ts +19 -5
- package/index.min.js +1 -1
- package/lib/core/codec-worker.js +11 -6
- package/lib/core/constants.js +19 -7
- package/lib/core/io.js +70 -51
- package/lib/core/streams/codec-stream.js +2 -3
- package/lib/core/z-worker-core.js +4 -2
- package/lib/core/zip-fs-core.js +6 -2
- package/lib/core/zip-reader.js +23 -11
- package/lib/core/zip-writer.js +146 -134
- package/lib/z-worker-inline.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -513,7 +513,7 @@ export class Reader<Type> implements Initializable, ReadableReader {
|
|
|
513
513
|
*
|
|
514
514
|
* @param index The byte index of the data to read.
|
|
515
515
|
* @param length The length of the data to read in bytes.
|
|
516
|
-
* @returns A promise resolving to a chunk of data.
|
|
516
|
+
* @returns A promise resolving to a chunk of data. The data must be trucated to the remaining size if the requested length is larger than the remaining size.
|
|
517
517
|
*/
|
|
518
518
|
readUint8Array(index: number, length: number): Promise<Uint8Array>;
|
|
519
519
|
}
|
|
@@ -1169,6 +1169,13 @@ export interface FileEntry extends Omit<EntryMetaData, "directory"> {
|
|
|
1169
1169
|
>,
|
|
1170
1170
|
options?: EntryGetDataCheckPasswordOptions
|
|
1171
1171
|
): Promise<Type>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Retrieves the content of the entry as an `ArrayBuffer` instance
|
|
1174
|
+
*
|
|
1175
|
+
* @param options The options.
|
|
1176
|
+
* @returns A promise resolving to an `ArrayBuffer` instance.
|
|
1177
|
+
*/
|
|
1178
|
+
arrayBuffer(options?: EntryGetDataOptions): Promise<ArrayBuffer>;
|
|
1172
1179
|
}
|
|
1173
1180
|
|
|
1174
1181
|
/**
|
|
@@ -1468,7 +1475,7 @@ export interface ZipWriterConstructorOptions {
|
|
|
1468
1475
|
*
|
|
1469
1476
|
* The minimum value is 0 and means that no compression is applied. The maximum value is 9.
|
|
1470
1477
|
*
|
|
1471
|
-
* @defaultValue
|
|
1478
|
+
* @defaultValue 6
|
|
1472
1479
|
*/
|
|
1473
1480
|
level?: number;
|
|
1474
1481
|
/**
|
|
@@ -1570,7 +1577,7 @@ export interface ZipWriterConstructorOptions {
|
|
|
1570
1577
|
/**
|
|
1571
1578
|
* `true` to add a data descriptor.
|
|
1572
1579
|
*
|
|
1573
|
-
* When set to `false`, the {@link ZipWriterConstructorOptions#bufferedWrite} option will automatically be
|
|
1580
|
+
* When set to `false`, the {@link ZipWriterConstructorOptions#bufferedWrite} option will automatically be
|
|
1574
1581
|
* set to `true`. It will be automatically set to `false` when it is `undefined` and the
|
|
1575
1582
|
* {@link ZipWriterConstructorOptions#bufferedWrite} option is set to `true`, or ` when the
|
|
1576
1583
|
* {@link ZipWriterConstructorOptions#zipCrypto} option is set to `true`. Otherwise, the default value is `true`.
|
|
@@ -1829,14 +1836,21 @@ export class ZipFileEntry<ReaderType, WriterType> extends ZipEntry {
|
|
|
1829
1836
|
* @param options The options.
|
|
1830
1837
|
* @returns A promise resolving to data associated to the {@link Writer} instance.
|
|
1831
1838
|
*/
|
|
1832
|
-
getData(
|
|
1839
|
+
getData<Type>(
|
|
1833
1840
|
writer:
|
|
1834
1841
|
| Writer<unknown>
|
|
1835
1842
|
| WritableWriter
|
|
1836
1843
|
| WritableStream
|
|
1837
1844
|
| AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream>,
|
|
1838
1845
|
options?: EntryGetDataOptions
|
|
1839
|
-
): Promise<
|
|
1846
|
+
): Promise<Type>;
|
|
1847
|
+
/**
|
|
1848
|
+
* Retrieves the content of the entry as an `ArrayBuffer` instance
|
|
1849
|
+
*
|
|
1850
|
+
* @param options The options.
|
|
1851
|
+
* @returns A promise resolving to an `ArrayBuffer` instance.
|
|
1852
|
+
*/
|
|
1853
|
+
getArrayBuffer(options?: EntryGetDataOptions): Promise<ArrayBuffer>;
|
|
1840
1854
|
/**
|
|
1841
1855
|
* Replaces the content of the entry with a `Blob` instance
|
|
1842
1856
|
*
|