New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

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

Package Overview
Dependencies
Maintainers
10
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Gatsby plugin for optional chaining operator

1.0.0
latest
Source
npm
Version published
Weekly downloads
259
43.09%
Maintainers
10
Weekly downloads
 
Created
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

gatsby

FAQs

Package last updated on 11 Nov 2019

Did you know?

Socket

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