babel-plugin-object-freeze

1.1.0 • Public • Published

babel-plugin-object-freeze

Travis build status NPM version Canonical Code Style Twitter Follow

Uses Object.freeze to freeze all object and array expressions.

Example transpilation

Input:

const config = {
  firstThreeAlphabetLetters: [
    'a',
    'b',
    'c'
  ]
};
 

Output:

const config = Object.freeze({
  firstThreeAlphabetLetters: Object.freeze([
    'a',
    'b',
    'c'
  ])
});
 

Motivation

To enforce complete immutability.

Configuration

N/A

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-object-freeze

Weekly Downloads

1

Version

1.1.0

License

BSD-3-Clause

Last publish

Collaborators

  • gajus