1.1.0 • Published 7 years ago

babel-plugin-object-freeze v1.1.0

Weekly downloads
3
License
BSD-3-Clause
Repository
github
Last release
7 years ago

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