Socket
Socket
Sign inDemoInstall

@bumped-inc/gatsby-plugin-optional-chaining

Package Overview
Dependencies
0
Maintainers
10
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bumped-inc/gatsby-plugin-optional-chaining

Gatsby plugin for optional chaining operator


Version published
Weekly downloads
262
increased by39.36%
Maintainers
10
Install size
1.87 kB
Created
Weekly downloads
 

Readme

Source

Optional chaining support for Gatsby's Babel config

Description

It enables the optional chaining operator (a ?. b): see the TC39 proposal

How to install

Install the plugin and its dependencies :

npm i @bumped-inc/gatsby-plugin-optional-chaining @babel/core @babel/plugin-proposal-optional-chaining

or

yarn add @bumped-inc/gatsby-plugin-optional-chaining @babel/core @babel/plugin-proposal-optional-chaining

Add the plugin in gatsby-config.js:

module.exports = {
  plugins: [
    // other plugins
    '@bumped-inc/gatsby-plugin-optional-chaining',
  ],
}

Examples of usage

const maybeObj = null;
const result = maybeObj?.value; // result: undefined

const actualObj = { value: 5 };
const betterResult = actualObj?.value // betterResult: 5

Keywords

FAQs

Last updated on 11 Nov 2019

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