Skip to content
Snippets Groups Projects
Unverified Commit 52b2bdbb authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

refactor(util/cache): Enable strict nulls (#12887)

parent 2c12ff1e
No related branches found
No related tags found
No related merge requests found
......@@ -11,16 +11,16 @@ import type { Cache } from './types';
// Increment this whenever there could be incompatibilities between old and new cache structure
export const CACHE_REVISION = 9;
let repositoryCache: RepositoryCacheConfig = 'disabled';
let cacheFileName: string;
let cache: Cache = Object.create({});
let repositoryCache: RepositoryCacheConfig | undefined = 'disabled';
let cacheFileName: string | null = null;
let cache: Cache | null = Object.create({});
export function getCacheFileName(config: RenovateConfig): string {
return join(
GlobalConfig.get('cacheDir'),
'/renovate/repository/',
config.platform,
config.repository + '.json'
`${config.repository}.json`
);
}
......@@ -63,7 +63,7 @@ export async function initialize(config: RenovateConfig): Promise<void> {
}
export function getCache(): Cache {
return cache || createCache();
return cache ?? createCache();
}
export async function finalize(): Promise<void> {
......
......@@ -23,7 +23,7 @@
"lib/platform/utils/pr-body.ts",
"lib/proxy.ts",
"lib/types/**/*.ts",
"lib/util/cache/package/*.ts",
"lib/util/cache/*.ts",
"lib/util/clone.ts",
"lib/util/date.ts",
"lib/util/exec/common.ts",
......@@ -66,6 +66,6 @@
"lib/datasource/helm/common.ts",
"lib/logger/err-serializer.spec.ts",
"lib/manager/gradle/shallow/types.ts",
"lib/util/cache/package/*.spec.ts"
"lib/util/cache/*.spec.ts"
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment