optional-chaining-tool
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

optional-chaining-tool

Build Status Coverage Status

a simple optional chaining tools for javascript.

use

import oc from 'optional-chaining-tool'

oc(object, 'a?')
oc(object, 'a?.["e"]')
oc(object, 'a?.f?.[0]?.l?.()')
oc(object, 'a?.f?.[0]?.v?.("hello!")?.z')

you can get more use case in test.js

not support Short-circuiting

option

stage 3 🎆🎆!!!

proposal-optional-chaining

so, you maybe just need a babel-plugin about this proposal.

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i optional-chaining-tool

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

2.87 kB

Total Files

4

Last publish

Collaborators

  • huangteng