Socket
Socket
Sign inDemoInstall

babel-plugin-transform-optional-catch-binding

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-transform-optional-catch-binding

Compile optional catch bindings


Version published
Weekly downloads
966
decreased by-32.59%
Maintainers
1
Install size
5.87 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-transform-optional-catch-binding

Optional catch binding enables the catch block to execute whether or not an argument is passed to the catch statement (CatchClause).

Examples

try {
  throw 0;
} catch {
  doSomethingWhichDoesntCareAboutTheValueThrown();
}
try {
  throw 0;
} catch {
  doSomethingWhichDoesntCareAboutTheValueThrown();
} finally {
  doSomeCleanup();
}

Installation

npm install --save-dev babel-plugin-transform-optional-catch-binding

Usage

.babelrc

{
  "plugins": ["transform-optional-catch-binding"]
}

Via CLI

babel --plugins transform-optional-catch-binding script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-optional-catch-binding"]
});

References

  • Proposal: Optional Catch Binding for ECMAScript

Keywords

FAQs

Last updated on 25 Jul 2017

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