Skip to content

Commit

Permalink
Add levenshteinDistance option check (#12447)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Mar 15, 2022
1 parent 4b7a39c commit f3917a3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/options-normalizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit f3917a3

Please sign in to comment.