Socket
Socket
Sign inDemoInstall

babel-plugin-ts-optchain

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-ts-optchain

Babel plugin for transpiling legacy browser support to [ts-optchain][] by removing Proxy usage.


Version published
Weekly downloads
120
increased by10.09%
Maintainers
1
Install size
23.9 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-ts-optchain

Babel plugin for transpiling legacy browser support to ts-optchain by removing Proxy usage.

Input:

import {oc} from "ts-optchain";
oc(data).foo.bar("default");

Output

import {oc} from "babel-plugin-ts-optchain/lib/runtime";
oc(data, ["foo", "bar"], "default");

The babel-plugin-ts-optchain/lib/runtime is a tiny mb like function.

Install

npm install babel-plugin-ts-optchain

and add it to your .babelrc with @babel/preset-typescript

{
    "presets": ["@babel/preset-typescript"],
    "plugins": ["ts-optchain"]
}

FAQs

Last updated on 24 Mar 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