Socket
Book a DemoInstallSign in
Socket

babel-plugin-object-freeze

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-object-freeze

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

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

immutable

FAQs

Package last updated on 06 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts