Socket
Socket
Sign inDemoInstall

@babel/helper-validator-option

Package Overview
Dependencies
0
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

@babel/helper-validator-option

Validate plugin/preset options

    7.23.5latest
    GitHub
    npm

Version published
Maintainers
4
Weekly downloads
35,631,066
increased by3.74%

Weekly downloads

Package description

What is @babel/helper-validator-option?

The @babel/helper-validator-option package is a utility for Babel's internal use. It provides helper functions to validate options passed to Babel plugins or presets. It ensures that the options are of the correct type and format before they are processed by Babel.

What are @babel/helper-validator-option's main functionalities?

Validation of Option Types

This feature allows developers to validate the type of an option passed to a Babel plugin or preset. The 'validator' function is used to create a validator for a specific option, which can then be used to check the type of the value passed for that option.

const { validator } = require('@babel/helper-validator-option');
const validateOption = validator('plugin-name', 'optionName', 'expectedType');
validateOption(someValue);

Custom Error Messages

This feature enables the customization of error messages when an invalid option is passed. Developers can provide a custom error message that will be displayed if the validation fails.

const { validator } = require('@babel/helper-validator-option');
const validateOption = validator('plugin-name', 'optionName', 'expectedType', 'Custom error message for invalid option.');
validateOption(someValue);

Other packages similar to @babel/helper-validator-option

Changelog

Source

v7.23.5 (2023-11-29)

:eyeglasses: Spec Compliance
  • babel-plugin-proposal-decorators
    • #16138 Class binding is in TDZ during decorators initialization (@nicolo-ribaudo)
  • babel-helpers, babel-plugin-proposal-decorators
:bug: Bug Fix
  • babel-traverse, babel-types
  • babel-plugin-transform-classes
  • babel-generator
  • babel-helpers
  • babel-helper-create-class-features-plugin, babel-plugin-transform-class-properties, babel-plugin-transform-typescript
  • babel-generator, babel-plugin-transform-modules-commonjs, babel-plugin-transform-parameters, babel-plugin-transform-typescript, babel-traverse
  • babel-eslint-plugin
:microscope: Output optimization

Readme

Source

@babel/helper-validator-option

Validate plugin/preset options

See our website @babel/helper-validator-option for more information.

Install

Using npm:

npm install --save @babel/helper-validator-option

or using yarn:

yarn add @babel/helper-validator-option

FAQs

Last updated on 29 Nov 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc