deep-seal
v2.2.1
Published
Performs Object.seal recursively on the functions and objects
Downloads
9
Maintainers
Readme
deep-seal
Recursively calls Object.seal on Functions and Objects. Based on the substack's deep-freeze module.
Installation
npm install deep-seal`
Or if you are a yarn user like me
yarn add deep-seal
Example usage
const deepSeal = require('deep-seal');
const x = {a: 'hello', b: 'world'}
delete x.a
console.log(x.a) // hello
x.c = 'afkslj'
console.log(x.c) // undefined
// Does not all the extension of object and
// does not let you delete the properties already present
methods
const deepSeal = require('deep-seal');
deepSeal(o)
Calls Object.seal
recursively on all unsealed properties that are functions or objects.
Parameters
- o (function or object, Object.seal is going to be applied on)
Returns
- o (same object but deeply sealed :smile: )
LICENSE
License under MIT LICENSE. See LICENSE for more details.