From 6659e7f084ec497557b3c5ceefbeeb72cd3c17c4 Mon Sep 17 00:00:00 2001 From: kaorun343 <5625395+kaorun343@users.noreply.github.com> Date: Mon, 26 Sep 2022 03:55:21 +0900 Subject: [PATCH] Update lib/utils/FileCache.js Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> --- lib/utils/FileCache.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/utils/FileCache.js b/lib/utils/FileCache.js index 8ec45bb4bc..297c3d7ded 100644 --- a/lib/utils/FileCache.js +++ b/lib/utils/FileCache.js @@ -23,6 +23,11 @@ class FileCache { cwd = process.cwd(), hashOfConfig = DEFAULT_HASH, ) { + if (![DEFAULT_CACHE_STRATEGY, CACHE_STRATEGY_CONTENT].includes(cacheStrategy)) { + throw new Error( + `"${cacheStrategy}" cache strategy is unsupported. Specify either "${DEFAULT_CACHE_STRATEGY}" or "${CACHE_STRATEGY_CONTENT}"`, + ); + } const cacheFile = path.resolve(getCacheFile(cacheLocation, cwd)); const useCheckSum = cacheStrategy !== DEFAULT_CACHE_STRATEGY;