Skip to content

Commit

Permalink
Remove manifest check
Browse files Browse the repository at this point in the history
  • Loading branch information
jpribyl committed Dec 2, 2022
1 parent 7012290 commit 814672a
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/Tar.ts
@@ -1,26 +1,20 @@
import { assertType } from 'typescript-is'
import { promises as fs } from 'fs'
import * as path from 'path'
import { promises as fs } from "fs";
import * as path from "path";

export interface Manifest {
Config: string
RepoTags: string[] | null
Layers: string[]
Config: string;
RepoTags: string[] | null;
Layers: string[];
}

export type Manifests = Manifest[]

export function assertManifests(x: unknown): asserts x is Manifests {
assertType<Manifests>(x)
}
export type Manifests = Manifest[];

export async function loadRawManifests(rootPath: string) {
return (await fs.readFile(path.join(rootPath, `manifest.json`))).toString()
return (await fs.readFile(path.join(rootPath, `manifest.json`))).toString();
}

export async function loadManifests(path: string) {
const raw = await loadRawManifests(path)
const manifests = JSON.parse(raw.toString())
assertManifests(manifests)
return manifests
const raw = await loadRawManifests(path);
const manifests = JSON.parse(raw.toString());
return manifests;
}

0 comments on commit 814672a

Please sign in to comment.