babel-plugin-immutable-const

1.0.3 • Public • Published

Babel plugin immutable const

Transform consted objects into immutable objects.

The object will be frozen. This will avoid future mutations on it. Update will simply be ignored and no errors will be thrown.

Installation

npm install --save-dev babel-plugin-immutable-const

Usage

Add the following line to your .babelrc file:

{
  "plugins": ["immutable-const"]
}

Example

const foo = { bar: true };

Will be transformed into:

const foo = Object.freeze({ bar: true });

/babel-plugin-immutable-const/

    Package Sidebar

    Install

    npm i babel-plugin-immutable-const

    Weekly Downloads

    2

    Version

    1.0.3

    License

    ISC

    Last publish

    Collaborators

    • xtuc