@zip.js/zip.js 2.8.30 → 2.8.31
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 +5 -4
- package/dist/zip-core.js +133 -334
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core.js +115 -277
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-native.js +170 -373
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +169 -372
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +138 -339
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-module.wasm +0 -0
- package/dist/zip-native.js +141 -342
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +140 -341
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +170 -373
- package/index-native.min.js +1 -1
- package/index.cjs +169 -372
- package/index.d.cts +2814 -0
- package/index.d.ts +238 -0
- package/index.min.js +1 -1
- package/lib/core/codec-worker.js +0 -10
- package/lib/core/configuration.js +21 -33
- package/lib/core/constants.js +3 -0
- package/lib/core/io.js +11 -19
- package/lib/core/streams/aes-crypto-stream.js +16 -20
- package/lib/core/streams/common-crypto.js +0 -2
- package/lib/core/streams/zip-crypto-stream.js +12 -16
- package/lib/core/streams/zip-entry-stream.js +2 -32
- package/lib/core/streams/zlib-js/zlib-streams.min.js +1 -1
- package/lib/core/streams/zlib-wasm/zlib-streams-loader.js +1 -3
- package/lib/core/streams/zlib-wasm/zlib-streams.wasm +0 -0
- package/lib/core/util/base64.js +68 -0
- package/lib/core/util/decode-text.js +0 -1
- package/lib/core/util/default-mime-type.js +0 -3
- package/lib/core/util/inflate.js +194 -0
- package/lib/core/util/mime-type.js +26 -22
- package/lib/core/util/opfs-temp-stream.js +1 -37
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-template-native.js +5 -5
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-fs.js +6 -13
- package/lib/core/zip-reader.js +48 -127
- package/lib/core/zip-writer.js +27 -45
- package/lib/core/zlib-streams-inline-template.js +3 -2
- package/lib/core/zlib-streams-inline.js +1 -1
- package/lib/zip-core-base.js +3 -1
- package/package.json +9 -6
- package/reserved-property-names.js +50 -0
- package/lib/core/util/mini-lz.js +0 -198
package/index.d.ts
CHANGED
|
@@ -392,6 +392,10 @@ export interface Initializable {
|
|
|
392
392
|
* Initializes the instance asynchronously
|
|
393
393
|
*/
|
|
394
394
|
init?(): Promise<void>;
|
|
395
|
+
/**
|
|
396
|
+
* `true` if the instance is initialized.
|
|
397
|
+
*/
|
|
398
|
+
initialized?: boolean;
|
|
395
399
|
}
|
|
396
400
|
|
|
397
401
|
/**
|
|
@@ -700,6 +704,22 @@ export class SplitDataWriter implements Initializable, WritableWriter {
|
|
|
700
704
|
* The `WritableStream` instance.
|
|
701
705
|
*/
|
|
702
706
|
writable: WritableStream;
|
|
707
|
+
/**
|
|
708
|
+
* The number of the disk being written.
|
|
709
|
+
*/
|
|
710
|
+
diskNumber: number;
|
|
711
|
+
/**
|
|
712
|
+
* The byte offset of the disk being written.
|
|
713
|
+
*/
|
|
714
|
+
diskOffset: number;
|
|
715
|
+
/**
|
|
716
|
+
* The maximum size of each disk in bytes.
|
|
717
|
+
*/
|
|
718
|
+
maxSize: number;
|
|
719
|
+
/**
|
|
720
|
+
* The number of bytes still available on the disk being written.
|
|
721
|
+
*/
|
|
722
|
+
availableSize: number;
|
|
703
723
|
/**
|
|
704
724
|
* Initializes the instance asynchronously
|
|
705
725
|
*/
|
|
@@ -1028,6 +1048,168 @@ export interface ZipReaderOptions {
|
|
|
1028
1048
|
preventClose?: boolean;
|
|
1029
1049
|
}
|
|
1030
1050
|
|
|
1051
|
+
/**
|
|
1052
|
+
* Represents the parsed general purpose bit flag of an entry.
|
|
1053
|
+
*/
|
|
1054
|
+
export interface EntryBitFlag {
|
|
1055
|
+
/**
|
|
1056
|
+
* The compression option bits.
|
|
1057
|
+
*/
|
|
1058
|
+
level: number;
|
|
1059
|
+
/**
|
|
1060
|
+
* `true` if the entry data is followed by a data descriptor.
|
|
1061
|
+
*/
|
|
1062
|
+
dataDescriptor: boolean;
|
|
1063
|
+
/**
|
|
1064
|
+
* `true` if the filename and the comment are encoded in UTF-8 (EFS).
|
|
1065
|
+
*/
|
|
1066
|
+
languageEncodingFlag: boolean;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Represents an extra field record of an entry.
|
|
1070
|
+
*/
|
|
1071
|
+
export interface EntryExtraField {
|
|
1072
|
+
/**
|
|
1073
|
+
* The type (header id) of the extra field.
|
|
1074
|
+
*/
|
|
1075
|
+
type: number;
|
|
1076
|
+
/**
|
|
1077
|
+
* The data of the extra field.
|
|
1078
|
+
*/
|
|
1079
|
+
data: Uint8Array;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Represents the AES extra field record of an entry.
|
|
1083
|
+
*/
|
|
1084
|
+
export interface EntryExtraFieldAES extends EntryExtraField {
|
|
1085
|
+
/**
|
|
1086
|
+
* The encryption strength (1, 2 or 3).
|
|
1087
|
+
*/
|
|
1088
|
+
strength?: number;
|
|
1089
|
+
/**
|
|
1090
|
+
* The compression method stored in the AES extra field.
|
|
1091
|
+
*/
|
|
1092
|
+
originalCompressionMethod?: number;
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Represents a Unicode path or comment extra field record of an entry.
|
|
1096
|
+
*/
|
|
1097
|
+
export interface EntryExtraFieldUnicode extends EntryExtraField {
|
|
1098
|
+
/**
|
|
1099
|
+
* `true` if the extra field is consistent with the entry metadata.
|
|
1100
|
+
*/
|
|
1101
|
+
valid?: boolean;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* Represents the local file header fields of an entry, read when getting the entry data.
|
|
1105
|
+
*/
|
|
1106
|
+
export interface LocalDirectory {
|
|
1107
|
+
/**
|
|
1108
|
+
* The "Version" field.
|
|
1109
|
+
*/
|
|
1110
|
+
version: number;
|
|
1111
|
+
/**
|
|
1112
|
+
* `true` if the entry is encrypted.
|
|
1113
|
+
*/
|
|
1114
|
+
encrypted: boolean;
|
|
1115
|
+
/**
|
|
1116
|
+
* The general purpose bit flag (raw).
|
|
1117
|
+
*/
|
|
1118
|
+
rawBitFlag: number;
|
|
1119
|
+
/**
|
|
1120
|
+
* The general purpose bit flag.
|
|
1121
|
+
*/
|
|
1122
|
+
bitFlag: EntryBitFlag;
|
|
1123
|
+
/**
|
|
1124
|
+
* The last modification date (raw).
|
|
1125
|
+
*/
|
|
1126
|
+
rawLastModDate: number;
|
|
1127
|
+
/**
|
|
1128
|
+
* The last modification date.
|
|
1129
|
+
*/
|
|
1130
|
+
lastModDate: Date;
|
|
1131
|
+
/**
|
|
1132
|
+
* The length of the filename in bytes.
|
|
1133
|
+
*/
|
|
1134
|
+
filenameLength: number;
|
|
1135
|
+
/**
|
|
1136
|
+
* The length of the extra field in bytes.
|
|
1137
|
+
*/
|
|
1138
|
+
extraFieldLength: number;
|
|
1139
|
+
/**
|
|
1140
|
+
* The extra field (raw).
|
|
1141
|
+
*/
|
|
1142
|
+
rawExtraField: Uint8Array;
|
|
1143
|
+
/**
|
|
1144
|
+
* The extra field.
|
|
1145
|
+
*/
|
|
1146
|
+
extraField?: Map<number, EntryExtraField>;
|
|
1147
|
+
/**
|
|
1148
|
+
* The signature (CRC32 checksum) of the content.
|
|
1149
|
+
*/
|
|
1150
|
+
signature?: number;
|
|
1151
|
+
/**
|
|
1152
|
+
* The compressed size of the content.
|
|
1153
|
+
*/
|
|
1154
|
+
compressedSize?: number;
|
|
1155
|
+
/**
|
|
1156
|
+
* The uncompressed size of the content.
|
|
1157
|
+
*/
|
|
1158
|
+
uncompressedSize?: number;
|
|
1159
|
+
/**
|
|
1160
|
+
* The compression method.
|
|
1161
|
+
*/
|
|
1162
|
+
compressionMethod?: number;
|
|
1163
|
+
/**
|
|
1164
|
+
* The Zip64 extra field.
|
|
1165
|
+
*/
|
|
1166
|
+
extraFieldZip64?: EntryExtraField;
|
|
1167
|
+
/**
|
|
1168
|
+
* The AES extra field.
|
|
1169
|
+
*/
|
|
1170
|
+
extraFieldAES?: EntryExtraFieldAES;
|
|
1171
|
+
/**
|
|
1172
|
+
* The NTFS extra field.
|
|
1173
|
+
*/
|
|
1174
|
+
extraFieldNTFS?: EntryExtraField;
|
|
1175
|
+
/**
|
|
1176
|
+
* The Unix extra field.
|
|
1177
|
+
*/
|
|
1178
|
+
extraFieldUnix?: EntryExtraField;
|
|
1179
|
+
/**
|
|
1180
|
+
* The Info-ZIP Unix extra field.
|
|
1181
|
+
*/
|
|
1182
|
+
extraFieldInfoZip?: EntryExtraField;
|
|
1183
|
+
/**
|
|
1184
|
+
* The extended timestamp extra field.
|
|
1185
|
+
*/
|
|
1186
|
+
extraFieldExtendedTimestamp?: EntryExtraField;
|
|
1187
|
+
/**
|
|
1188
|
+
* The Unicode path extra field.
|
|
1189
|
+
*/
|
|
1190
|
+
extraFieldUnicodePath?: EntryExtraFieldUnicode;
|
|
1191
|
+
/**
|
|
1192
|
+
* The Unicode comment extra field.
|
|
1193
|
+
*/
|
|
1194
|
+
extraFieldUnicodeComment?: EntryExtraFieldUnicode;
|
|
1195
|
+
/**
|
|
1196
|
+
* The USDZ extra field.
|
|
1197
|
+
*/
|
|
1198
|
+
extraFieldUSDZ?: EntryExtraField;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Represents an error raised while processing an entry, decorated with entry context.
|
|
1202
|
+
*/
|
|
1203
|
+
export interface EntryError extends Error {
|
|
1204
|
+
/**
|
|
1205
|
+
* `true` if the zip file is corrupted because the entry data could not be written entirely.
|
|
1206
|
+
*/
|
|
1207
|
+
corruptedEntry?: boolean;
|
|
1208
|
+
/**
|
|
1209
|
+
* The id of the related {@link ZipEntry} (filesystem API).
|
|
1210
|
+
*/
|
|
1211
|
+
entryId?: number;
|
|
1212
|
+
}
|
|
1031
1213
|
/**
|
|
1032
1214
|
* Represents the metadata of an entry in a zip file (Core API).
|
|
1033
1215
|
*/
|
|
@@ -1225,6 +1407,62 @@ export interface EntryMetaData {
|
|
|
1225
1407
|
* The compression method.
|
|
1226
1408
|
*/
|
|
1227
1409
|
compressionMethod: number;
|
|
1410
|
+
/**
|
|
1411
|
+
* The general purpose bit flag (raw).
|
|
1412
|
+
*/
|
|
1413
|
+
rawBitFlag?: number;
|
|
1414
|
+
/**
|
|
1415
|
+
* The general purpose bit flag.
|
|
1416
|
+
*/
|
|
1417
|
+
bitFlag?: EntryBitFlag;
|
|
1418
|
+
/**
|
|
1419
|
+
* The length of the filename in bytes.
|
|
1420
|
+
*/
|
|
1421
|
+
filenameLength?: number;
|
|
1422
|
+
/**
|
|
1423
|
+
* The length of the extra field in bytes.
|
|
1424
|
+
*/
|
|
1425
|
+
extraFieldLength?: number;
|
|
1426
|
+
/**
|
|
1427
|
+
* The Zip64 extra field.
|
|
1428
|
+
*/
|
|
1429
|
+
extraFieldZip64?: EntryExtraField;
|
|
1430
|
+
/**
|
|
1431
|
+
* The AES extra field.
|
|
1432
|
+
*/
|
|
1433
|
+
extraFieldAES?: EntryExtraFieldAES;
|
|
1434
|
+
/**
|
|
1435
|
+
* The NTFS extra field.
|
|
1436
|
+
*/
|
|
1437
|
+
extraFieldNTFS?: EntryExtraField;
|
|
1438
|
+
/**
|
|
1439
|
+
* The Unix extra field.
|
|
1440
|
+
*/
|
|
1441
|
+
extraFieldUnix?: EntryExtraField;
|
|
1442
|
+
/**
|
|
1443
|
+
* The Info-ZIP Unix extra field.
|
|
1444
|
+
*/
|
|
1445
|
+
extraFieldInfoZip?: EntryExtraField;
|
|
1446
|
+
/**
|
|
1447
|
+
* The extended timestamp extra field.
|
|
1448
|
+
*/
|
|
1449
|
+
extraFieldExtendedTimestamp?: EntryExtraField;
|
|
1450
|
+
/**
|
|
1451
|
+
* The Unicode path extra field.
|
|
1452
|
+
*/
|
|
1453
|
+
extraFieldUnicodePath?: EntryExtraFieldUnicode;
|
|
1454
|
+
/**
|
|
1455
|
+
* The Unicode comment extra field.
|
|
1456
|
+
*/
|
|
1457
|
+
extraFieldUnicodeComment?: EntryExtraFieldUnicode;
|
|
1458
|
+
/**
|
|
1459
|
+
* The USDZ extra field.
|
|
1460
|
+
*/
|
|
1461
|
+
extraFieldUSDZ?: EntryExtraField;
|
|
1462
|
+
/**
|
|
1463
|
+
* The local file header fields, set when the entry data has been read.
|
|
1464
|
+
*/
|
|
1465
|
+
localDirectory?: LocalDirectory;
|
|
1228
1466
|
}
|
|
1229
1467
|
export interface DirectoryEntry extends EntryMetaData {
|
|
1230
1468
|
/**
|