Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/helper-validator-option

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-validator-option - npm Package Compare versions

Comparing version 7.21.4-esm.4 to 7.22.5

8

lib/find-suggestion.js

@@ -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

13

lib/validator.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc