deep-seal

    2.2.1 • Public • Published

    deep-seal

    TravisCI Build Status

    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 😄 )

    LICENSE

    License under MIT LICENSE. See LICENSE for more details.

    Install

    npm i deep-seal

    DownloadsWeekly Downloads

    16

    Version

    2.2.1

    License

    MIT

    Last publish

    Collaborators

    • computistic