@babel/helper-validator-option
Advanced tools
Comparing version 7.21.4-esm.2 to 7.21.4-esm.3
@@ -0,1 +1,7 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.findSuggestion = findSuggestion; | ||
const { | ||
@@ -28,3 +34,3 @@ min | ||
} | ||
export function findSuggestion(str, arr) { | ||
function findSuggestion(str, arr) { | ||
const distances = arr.map(el => levenshtein(el, str)); | ||
@@ -31,0 +37,0 @@ return arr[distances.indexOf(min(...distances))]; |
@@ -1,4 +0,21 @@ | ||
export { OptionValidator } from "./validator.js"; | ||
export { findSuggestion } from "./find-suggestion.js"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "OptionValidator", { | ||
enumerable: true, | ||
get: function () { | ||
return _validator.OptionValidator; | ||
} | ||
}); | ||
Object.defineProperty(exports, "findSuggestion", { | ||
enumerable: true, | ||
get: function () { | ||
return _findSuggestion.findSuggestion; | ||
} | ||
}); | ||
var _validator = require("./validator"); | ||
var _findSuggestion = require("./find-suggestion"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,9 @@ | ||
import { findSuggestion } from "./find-suggestion.js"; | ||
export class OptionValidator { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.OptionValidator = void 0; | ||
var _findSuggestion = require("./find-suggestion"); | ||
class OptionValidator { | ||
constructor(descriptor) { | ||
@@ -11,3 +17,3 @@ this.descriptor = descriptor; | ||
throw new Error(this.formatMessage(`'${option}' is not a valid top-level option. | ||
- Did you mean '${findSuggestion(option, validOptionNames)}'?`)); | ||
- Did you mean '${(0, _findSuggestion.findSuggestion)(option, validOptionNames)}'?`)); | ||
} | ||
@@ -41,3 +47,4 @@ } | ||
} | ||
exports.OptionValidator = OptionValidator; | ||
//# sourceMappingURL=validator.js.map |
{ | ||
"name": "@babel/helper-validator-option", | ||
"version": "7.21.4-esm.2", | ||
"version": "7.21.4-esm.3", | ||
"description": "Validate plugin/preset options", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
11629
102