use type vs object (#238187)

use object type instead
pull/235174/merge
Megan Rogge 2025-01-19 10:02:50 -06:00 committed by GitHub
parent 1600fb4c76
commit 58145651f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@
import { osIsWindows } from './os';
import * as fs from 'fs/promises';
export async function isExecutable(filePath: string, configuredWindowsExecutableExtensions?: Object): Promise<boolean> {
export async function isExecutable(filePath: string, configuredWindowsExecutableExtensions?: { [key: string]: boolean | undefined }): Promise<boolean> {
if (osIsWindows()) {
const resolvedWindowsExecutableExtensions = resolveWindowsExecutableExtensions(configuredWindowsExecutableExtensions);
return resolvedWindowsExecutableExtensions.find(ext => filePath.endsWith(ext)) !== undefined;
@ -21,7 +21,8 @@ export async function isExecutable(filePath: string, configuredWindowsExecutable
}
}
function resolveWindowsExecutableExtensions(configuredWindowsExecutableExtensions?: Object): string[] {
function resolveWindowsExecutableExtensions(configuredWindowsExecutableExtensions?: { [key: string]: boolean | undefined }): string[] {
const resolvedWindowsExecutableExtensions: string[] = windowsDefaultExecutableExtensions;
const excluded = new Set<string>();
if (configuredWindowsExecutableExtensions) {