1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix type errors

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-10-11 09:05:42 -04:00
parent 2979a774f6
commit f1bedd9580

View File

@ -5,7 +5,6 @@
// Helper for working with tarball files (.tar, .tgz) // Helper for working with tarball files (.tar, .tgz)
// Docs: https://github.com/npm/node-tar // Docs: https://github.com/npm/node-tar
import type { FileStat } from "tar";
import tar from "tar"; import tar from "tar";
import path from "path"; import path from "path";
import { parse } from "./json"; import { parse } from "./json";
@ -35,7 +34,7 @@ export function readFileFromTar<ParseJson extends boolean>({ tarPath, filePath,
file: tarPath, file: tarPath,
filter: entryPath => path.normalize(entryPath) === filePath, filter: entryPath => path.normalize(entryPath) === filePath,
sync: true, sync: true,
onentry(entry: FileStat) { onentry(entry) {
entry.on("data", chunk => { entry.on("data", chunk => {
fileChunks.push(chunk); fileChunks.push(chunk);
}); });
@ -63,7 +62,7 @@ export async function listTarEntries(filePath: string): Promise<string[]> {
await tar.list({ await tar.list({
file: filePath, file: filePath,
onentry: (entry) => { onentry: (entry) => {
entries.push(path.normalize(entry.path as unknown as string)); entries.push(path.normalize(entry.path));
}, },
}); });