1.0.0 • Published 8 years ago

babel-plugin-negative-array-indices v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

babel-plugin-negative-array-indices

A babel plugin for accessing arrays from the rear.

I'd love to get feedback, just open a new issue or drop me an email.

Usage / Options

Put this in your .babelrc:

plugins: [
    ["negative-array-indices", {}]
 ]
Transformations

x[-1]x[x.length - 1]

x[-2]x[x.length - 2]

x[0] will not be changed.

Expressions like x[0-2] also won't be changed, even if they result in negative indices.

Spec

deepAccess_spec.js

1.0.0

8 years ago