babel-plugin-object-freeze
v1.1.0
Published
Uses Object.freeze to freeze all object and array expressions.
Readme
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
