Skip to content

Commit fa16742

Browse files
committed
Add comments
1 parent 814ac74 commit fa16742

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/console/src/csv/ZipStreamHelper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { JSZipObject, OnUpdateCallback, JSZipStreamHelper } from 'jszip';
22

3+
/**
4+
* This is used to help papaparse understand our stream.
5+
* It uses these fields for feature detection, but never actually calls read()
6+
* https://github.com/mholt/PapaParse/blob/master/papaparse.js#L244
7+
*/
38
interface ZipStreamHelper extends JSZipStreamHelper<string> {
49
readable: boolean;
510
read(): void;
@@ -14,6 +19,7 @@ export default function makeZipStreamHelper(
1419
zipObj as JSZipObject & {
1520
// The type could be anything except nodebuffer from https://stuk.github.io/jszip/documentation/api_zipobject/internal_stream.html
1621
// We only need it as a string though
22+
// JSZip types don't include this method for some reason
1723
internalStream(type: 'string'): JSZipStreamHelper<string>;
1824
}
1925
).internalStream('string') as ZipStreamHelper;

0 commit comments

Comments
 (0)