Skip to content

Commit fb812b8

Browse files
committed
fix: updated some types
1 parent 718867f commit fb812b8

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/VirtualTar.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,6 @@ class VirtualTar {
2626
| Partial<Record<MetadataKeywords, string>>
2727
| undefined;
2828

29-
protected addEntry(
30-
filePath: string,
31-
type: 'file' | 'directory',
32-
stat?: FileStat,
33-
data?: Uint8Array | string,
34-
): void;
35-
36-
protected addEntry(
37-
filePath: string,
38-
type: 'file' | 'directory',
39-
stat?: FileStat,
40-
callback?: (write: (chunk: string | Uint8Array) => void) => void,
41-
): void;
42-
4329
protected addEntry(
4430
filePath: string,
4531
type: 'file' | 'directory',
@@ -130,6 +116,24 @@ class VirtualTar {
130116
filePath: string,
131117
stat: FileStat,
132118
data?: Uint8Array | string,
119+
): void;
120+
121+
public addFile(
122+
filePath: string,
123+
stat: FileStat,
124+
data?:
125+
| Uint8Array
126+
| string
127+
| ((writer: (chunk: string | Uint8Array) => void) => void),
128+
): void;
129+
130+
public addFile(
131+
filePath: string,
132+
stat: FileStat,
133+
data?:
134+
| Uint8Array
135+
| string
136+
| ((writer: (chunk: string | Uint8Array) => void) => void),
133137
): void {
134138
if (this.state !== VirtualTarState.GENERATOR) {
135139
throw new errors.ErrorVirtualTarInvalidState(
@@ -267,18 +271,14 @@ class VirtualTar {
267271
return { type: 'empty', awaitingData: false };
268272
}
269273

270-
public parseAvailable(): Array<
271-
ParsedFile | ParsedDirectory | ParsedMetadata | ParsedEmpty
272-
> {
274+
public parseAvailable(): Array<ParsedFile | ParsedDirectory> {
273275
if (this.state !== VirtualTarState.PARSER) {
274276
throw new errors.ErrorVirtualTarInvalidState(
275277
'VirtualTar is not in parser mode',
276278
);
277279
}
278280

279-
const parsedTokens: Array<
280-
ParsedFile | ParsedDirectory | ParsedMetadata | ParsedEmpty
281-
> = [];
281+
const parsedTokens: Array<ParsedFile | ParsedDirectory> = [];
282282
let token;
283283
while (token.type !== 'empty' && !token.awaitingData) {
284284
token = this.next();

0 commit comments

Comments
 (0)