Socket
Socket
Sign inDemoInstall

@babel/helper-validator-option

Package Overview
Dependencies
0
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @babel/helper-validator-option

Validate plugin/preset options


Version published
Weekly downloads
37M
increased by1.84%
Maintainers
4
Install size
11.4 kB
Created
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 for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your 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