We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30bac2c commit d1e23f5Copy full SHA for d1e23f5
tests/legacy-cli/e2e/utils/tar.ts
@@ -19,16 +19,14 @@ import { Parse } from 'tar';
19
*/
20
export async function extractFile(tarball: string, filePath: string): Promise<Buffer> {
21
return new Promise((resolve, reject) => {
22
- let chunks: Buffer[] | null = null;
23
-
24
fs.createReadStream(tarball)
25
.pipe(
26
new Parse({
27
strict: true,
28
filter: (p) => normalize(p) === normalize(filePath),
29
// TODO: @types/tar 'entry' does not have ReadEntry.on
30
onentry: (entry: any) => {
31
- chunks = [];
+ const chunks: Buffer[] = [];
32
33
entry.on('data', (chunk: any) => chunks!.push(chunk));
34
entry.on('error', reject);
0 commit comments