Skip to content

Commit 47f2bd3

Browse files
committed
Remove manifest check
1 parent 7012290 commit 47f2bd3

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

src/LayerCache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ class LayerCache {
347347
async getLayerTarFiles(): Promise<string[]> {
348348
const getTarFilesFromManifest = (manifest: Manifest) => manifest.Layers;
349349

350-
const tarFilesThatMayDuplicate = (await this.getManifests()).flatMap(
351-
getTarFilesFromManifest
352-
);
350+
const tarFilesThatMayDuplicate: string = (
351+
await this.getManifests()
352+
).flatMap(getTarFilesFromManifest);
353353
const tarFiles = [...new Set(tarFilesThatMayDuplicate)];
354354
return tarFiles;
355355
}

src/Tar.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
import { assertType } from 'typescript-is'
2-
import { promises as fs } from 'fs'
3-
import * as path from 'path'
1+
import { promises as fs } from "fs";
2+
import * as path from "path";
43

54
export interface Manifest {
6-
Config: string
7-
RepoTags: string[] | null
8-
Layers: string[]
5+
Config: string;
6+
RepoTags: string[] | null;
7+
Layers: string[];
98
}
109

11-
export type Manifests = Manifest[]
12-
13-
export function assertManifests(x: unknown): asserts x is Manifests {
14-
assertType<Manifests>(x)
15-
}
10+
export type Manifests = Manifest[];
1611

1712
export async function loadRawManifests(rootPath: string) {
18-
return (await fs.readFile(path.join(rootPath, `manifest.json`))).toString()
13+
return (await fs.readFile(path.join(rootPath, `manifest.json`))).toString();
1914
}
2015

2116
export async function loadManifests(path: string) {
22-
const raw = await loadRawManifests(path)
23-
const manifests = JSON.parse(raw.toString())
24-
assertManifests(manifests)
25-
return manifests
17+
const raw = await loadRawManifests(path);
18+
const manifests = JSON.parse(raw.toString());
19+
return manifests;
2620
}

0 commit comments

Comments
 (0)