@babel/helper-validator-option
Advanced tools
Comparing version 7.21.4-esm.4 to 7.22.5
@@ -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.4", | ||
"version": "7.22.5", | ||
"description": "Validate plugin/preset options", | ||
@@ -23,3 +23,3 @@ "repository": { | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "module" | ||
"type": "commonjs" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11621
102
1
9
No