File tree 2 files changed +13
-19
lines changed 2 files changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -347,9 +347,9 @@ class LayerCache {
347
347
async getLayerTarFiles ( ) : Promise < string [ ] > {
348
348
const getTarFilesFromManifest = ( manifest : Manifest ) => manifest . Layers ;
349
349
350
- const tarFilesThatMayDuplicate = ( await this . getManifests ( ) ) . flatMap (
351
- getTarFilesFromManifest
352
- ) ;
350
+ const tarFilesThatMayDuplicate : string = (
351
+ await this . getManifests ( )
352
+ ) . flatMap ( getTarFilesFromManifest ) ;
353
353
const tarFiles = [ ...new Set ( tarFilesThatMayDuplicate ) ] ;
354
354
return tarFiles ;
355
355
}
Original file line number Diff line number Diff line change 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" ;
4
3
5
4
export interface Manifest {
6
- Config : string
7
- RepoTags : string [ ] | null
8
- Layers : string [ ]
5
+ Config : string ;
6
+ RepoTags : string [ ] | null ;
7
+ Layers : string [ ] ;
9
8
}
10
9
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 [ ] ;
16
11
17
12
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 ( ) ;
19
14
}
20
15
21
16
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 ;
26
20
}
You can’t perform that action at this time.
0 commit comments