Add levenshteinDistance option check (#12447)
This commit is contained in:
1 parent
4b7a39c936
commit
f3917a3a46
1 file changed
+8
-2
@@ -271,8 +271,14 @@ function normalizeApiOptions(options, optionInfos, opts) {
|
||||
|
||||
function normalizeCliOptions(options, optionInfos, opts) {
|
||||
/* istanbul ignore next */
|
||||
if (process.env.NODE_ENV !== "production" && !opts.colorsModule) {
|
||||
throw new Error("'colorsModule' option is required.");
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
if (!opts.colorsModule) {
|
||||
throw new Error("'colorsModule' option is required.");
|
||||
}
|
||||
|
||||
if (!opts.levenshteinDistance) {
|
||||
throw new Error("'levenshteinDistance' option is required.");
|
||||
}
|
||||
}
|
||||
|
||||
return normalizeOptions(options, optionInfos, { isCLI: true, ...opts });
|
||||
|
||||
Reference in new issue
Block a user