2.2.1 • Published 9 years ago
deep-seal v2.2.1
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-sealExample 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 presentmethods
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.