babel-plugin-null-safe-accessor

[Deprecated] A Babel plugin to provide null safe accessor syntax like Groovy's

Downloads
9
Stars
8
Committers
1

[Deprecated] babel-plugin-null-safe-accessor

A Babel plugin to provide null safe accessor syntax like Groovy's.

This plugin requires npm@3's flattened node_modules because of monkey-patching to babel's dependencies.

Before:

var b = a?.b;
a.b?(c);

After:

var b = a == null ? a : a.b;
a.b == null ? a.b : a.b(c);

Installation

npm install -D babel-plugin-null-safe-accessor

.babelrc:

{
  "plugins": ["null-safe-accessor"]
}
Package Rankings
Top 16.27% on Npmjs.org
Badges
Extracted from project README
build status npm version npm downloads
Related Projects