diff --git a/src/core/cache.ts b/src/core/cache.ts index b7eb6ed..5373a6d 100644 --- a/src/core/cache.ts +++ b/src/core/cache.ts @@ -10,7 +10,7 @@ export interface JSONCache { find(fn: (value: T, key: string) => boolean): T } -interface ManagedJSONCache extends JSONCache { +interface ManagedJSONCache extends JSONCache { save(): void } @@ -21,14 +21,14 @@ export function loadCache( cachePath: string, onLoad?: (cache: JSONCache) => void ): JSONCache { - let cache: JSONCache = caches[cachePath] + let cache: ManagedJSONCache = caches[cachePath] if (cache) { return cache } let data: any try { data = fs.readJson(cachePath) - } catch (err) { + } catch (err: any) { if (err.code == fs.NOT_REAL) { data = {} } else { diff --git a/src/core/config.ts b/src/core/config.ts index ffdce13..5de697f 100644 --- a/src/core/config.ts +++ b/src/core/config.ts @@ -54,7 +54,7 @@ export function loadConfig(configPath = findConfig(), force?: boolean) { let rawConfig: any try { rawConfig = fs.readJson(configPath) - } catch (err) { + } catch (err: any) { if (err.code == fs.NOT_REAL) return null throw err } diff --git a/src/core/git.ts b/src/core/git.ts index 1230123..17a6d87 100644 --- a/src/core/git.ts +++ b/src/core/git.ts @@ -90,7 +90,7 @@ function parseGitString( let commit: string | undefined let subpath: string | undefined - if (gitString?.length > 0) { + if (gitString) { if (gitString.includes(':')) { ;[gitString, subpath] = gitString.split(':') } diff --git a/src/core/installPackages.ts b/src/core/installPackages.ts index 09417ca..ce306b1 100644 --- a/src/core/installPackages.ts +++ b/src/core/installPackages.ts @@ -36,7 +36,7 @@ export async function installPackages(packages: Package[], force?: boolean) { task.finish() log.debug('install completed:', yellow(cwdRelative(pkg.root))) log.events.emit('install', pkg) - } catch (e) { + } catch (e: any) { task.finish() log.error('Installation failed:', yellow(cwdRelative(pkg.root))) if (isTest) { diff --git a/src/core/sparseClone.ts b/src/core/sparseClone.ts index 02a3709..99366c2 100644 --- a/src/core/sparseClone.ts +++ b/src/core/sparseClone.ts @@ -9,7 +9,7 @@ export function sparseClone( url: string, branch: string | undefined, commit: string | undefined, - subpath: string | undefined + subpath: string ) { fs.mkdir(dest) let checkoutCommand = `git clone ${url} . --no-checkout --depth 1`