Skip to content

Commit 6a90b80

Browse files
committed
Simplify Context
1 parent 8efd2db commit 6a90b80

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/config-inferrer.spec.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,9 @@ import { WorkspaceConfig } from './config';
55

66
function context(files: {[path:string]:string}): Context {
77
return {
8-
98
config: {},
10-
11-
async exists(path: string) {
12-
return path.toString() in files;
13-
},
14-
async getFullPath(path: string) {
15-
return path.toString();
16-
},
17-
async list(path: string) {
18-
return Object.keys(files).filter(c => c.startsWith(path.toString())).map(c => files[c]);
19-
},
20-
async read(path: string) {
21-
return files[path.toString()];
22-
},
9+
exists: async (path: string) => path.toString() in files,
10+
read: async (path: string) => files[path.toString()],
2311
}
2412
}
2513

src/config-inferrer.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import { WorkspaceConfig } from './config';
22

33
export interface Context {
44
config: WorkspaceConfig;
5-
getFullPath(path: string): Promise<string>;
65
exists(path: string): Promise<boolean>;
76
read(path: string): Promise<string | undefined>;
8-
list(folderPath: string): Promise<string[]>;
97
}
108

119
export class ConfigInferrer {

0 commit comments

Comments
 (0)