Skip to content

Commit ce3c0ba

Browse files
committed
chore(fix): typescript errors
1 parent 94cca1c commit ce3c0ba

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/core/cache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface JSONCache<T = any> {
1010
find(fn: (value: T, key: string) => boolean): T
1111
}
1212

13-
interface ManagedJSONCache extends JSONCache {
13+
interface ManagedJSONCache<T = any> extends JSONCache<T> {
1414
save(): void
1515
}
1616

@@ -21,14 +21,14 @@ export function loadCache<T>(
2121
cachePath: string,
2222
onLoad?: (cache: JSONCache<T>) => void
2323
): JSONCache<T> {
24-
let cache: JSONCache<T> = caches[cachePath]
24+
let cache: ManagedJSONCache<T> = caches[cachePath]
2525
if (cache) {
2626
return cache
2727
}
2828
let data: any
2929
try {
3030
data = fs.readJson(cachePath)
31-
} catch (err) {
31+
} catch (err: any) {
3232
if (err.code == fs.NOT_REAL) {
3333
data = {}
3434
} else {

src/core/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function loadConfig(configPath = findConfig(), force?: boolean) {
5454
let rawConfig: any
5555
try {
5656
rawConfig = fs.readJson(configPath)
57-
} catch (err) {
57+
} catch (err: any) {
5858
if (err.code == fs.NOT_REAL) return null
5959
throw err
6060
}

src/core/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function parseGitString(
9090
let commit: string | undefined
9191
let subpath: string | undefined
9292

93-
if (gitString?.length > 0) {
93+
if (gitString) {
9494
if (gitString.includes(':')) {
9595
;[gitString, subpath] = gitString.split(':')
9696
}

src/core/installPackages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function installPackages(packages: Package[], force?: boolean) {
3636
task.finish()
3737
log.debug('install completed:', yellow(cwdRelative(pkg.root)))
3838
log.events.emit('install', pkg)
39-
} catch (e) {
39+
} catch (e: any) {
4040
task.finish()
4141
log.error('Installation failed:', yellow(cwdRelative(pkg.root)))
4242
if (isTest) {

src/core/sparseClone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function sparseClone(
99
url: string,
1010
branch: string | undefined,
1111
commit: string | undefined,
12-
subpath: string | undefined
12+
subpath: string
1313
) {
1414
fs.mkdir(dest)
1515
let checkoutCommand = `git clone ${url} . --no-checkout --depth 1`

0 commit comments

Comments
 (0)