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 });

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-immutable-const

Weekly Downloads

4

Version

1.0.3

License

ISC

Last publish

Collaborators

  • xtuc