Skip to content

Commit 89ef419

Browse files
Copilotjoshspicer
andcommitted
Fix linting issue by properly typing repository item validator
Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
1 parent 3a26279 commit 89ef419

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/platform/github/common/githubAPIValidators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ export const vClosePullRequestResponse = (): IValidator<ClosePullRequestResponse
170170
export interface RepositoryItem {
171171
name: string;
172172
path: string;
173-
type: string;
173+
type: 'file' | 'dir';
174174
html_url: string;
175175
}
176176

177177
export const vRepositoryItem = (): IValidator<RepositoryItem> => vObj({
178178
name: vRequired(vString()),
179179
path: vRequired(vString()),
180-
type: vRequired(vString()),
180+
type: vRequired(vEnum('file', 'dir')),
181181
html_url: vRequired(vString()),
182182
});
183183

src/platform/github/node/githubRepositoryService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class GithubRepositoryService implements IGithubRepositoryService {
8686
}
8787

8888
for (const child of validation.content) {
89-
paths.push({ name: child.name, path: child.path, type: child.type as any, html_url: child.html_url });
89+
paths.push({ name: child.name, path: child.path, type: child.type, html_url: child.html_url });
9090
if (child.type === 'dir') {
9191
paths.push(...await this.getRepositoryItems(org, repo, child.path));
9292
}

0 commit comments

Comments
 (0)