npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

babel-plugin-object-freeze

1.1.0

@gajus

npmHomeRepoSnykSocket
Downloads:0
$ npm install babel-plugin-object-freeze
DailyWeeklyMonthlyYearly

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
  • Motivation
  • Configuration

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