babel-plugin-object-freeze

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

OTHER License

Downloads
10
Stars
8
Committers
1

babel-plugin-object-freeze

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

Package Rankings
Top 20.22% on Npmjs.org
Badges
Extracted from project README
Travis build status NPM version Canonical Code Style Twitter Follow
Related Projects