mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[jszip] Add decodeFileName option for JSZipLoadOptions interface (#35434)
This commit is contained in:
parent
bf6a6c6395
commit
1a6d749bd5
1
types/jszip/index.d.ts
vendored
1
types/jszip/index.d.ts
vendored
@ -132,6 +132,7 @@ declare namespace JSZip {
|
||||
checkCRC32?: boolean;
|
||||
optimizedBinaryString?: boolean;
|
||||
createFolders?: boolean;
|
||||
decodeFileName?(filenameBytes: Uint8Array): string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,13 @@ function testJSZip() {
|
||||
const zip = createTestZip();
|
||||
zip.generateAsync({compression: "DEFLATE", type: "base64"}).then((serializedZip) => {
|
||||
const newJszip = new JSZip();
|
||||
return newJszip.loadAsync(serializedZip, {base64: true/*, checkCRC32: true*/});
|
||||
return newJszip.loadAsync(serializedZip, {
|
||||
base64: true,
|
||||
checkCRC32: true,
|
||||
optimizedBinaryString: true,
|
||||
createFolders: true,
|
||||
decodeFileName: filenameBytes => filenameBytes.toString()
|
||||
});
|
||||
}).then((newJszip: JSZip) => {
|
||||
newJszip.file("test.txt").async('text').then((text: string) => {
|
||||
if (text === "test string") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user