Skip to content

Commit

Permalink
chore(fix): typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Apr 15, 2024
1 parent 94cca1c commit ce3c0ba
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/core/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface JSONCache<T = any> {
find(fn: (value: T, key: string) => boolean): T
}

interface ManagedJSONCache extends JSONCache {
interface ManagedJSONCache<T = any> extends JSONCache<T> {
save(): void
}

Expand All @@ -21,14 +21,14 @@ export function loadCache<T>(
cachePath: string,
onLoad?: (cache: JSONCache<T>) => void
): JSONCache<T> {
let cache: JSONCache<T> = caches[cachePath]
let cache: ManagedJSONCache<T> = 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 {
Expand Down
2 changes: 1 addition & 1 deletion src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(':')
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/installPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/sparseClone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit ce3c0ba

Please sign in to comment.