Deep Lockdown
Recursively call Object.freeze()
, Object.seal()
, and Object.preventExtensions()
on objects.
This is based on the deep-freeze library but takes it a step further and prevents new properties from being added or removed to the object. It also marks all existing properties as non-configurable.
Install
npm install deep-lockdown
Usage
var deepLockdown = ; var myObj = a: 'a' b: 'b' c: e: q: 'word' ; ; myObjd = 'd';myObja = 'jkl';myObjceq = 'different-word';myObjcef = 'add-some-words'; console;
var myObj = { a: 'a', b: 'b', c: { e: { q: 'word' } } };