1.0.0 • Published 5 years ago

babel-plugin-assume-first-argument v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Assume First Argument

Babel plugin which reuses a uncommon unary operator for a more common purpose.

['foo', 'bar'].map(~length); // => ['foo', 'bar'].map(uid => uid.length);
[{ foo: 1 }, { foo: 2 }, { foo: 3 }].map(~foo % 2 === 0); // => ...map(uid => uid.foo % 2 === 0)

I initially wanted to use a better syntax, but realized that you can only write Babel plugins for Javascript syntax that they support. This may change in the future.