Skip to content

recursively Object.freeze() on objects and functions

License

Notifications You must be signed in to change notification settings

NationalBankBelgium/deep-freeze

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deep-freeze

recursively Object.freeze() objects

build status

example

var deepFreeze = require('deep-freeze');

deepFreeze(Buffer);
Buffer.x = 5;
console.log(Buffer.x === undefined);

Buffer.prototype.z = 3;
console.log(Buffer.prototype.z === undefined);

$ node example/deep.js
true
true

methods

var deepFreeze = require('deep-freeze')

deepFreeze(obj)

Call Object.freeze(obj) recursively on all unfrozen properties of obj that are functions or objects.

license

public domain

Based in part on the code snippet from the MDN wiki page on Object.freeze(), which is released to the public domain.

About

recursively Object.freeze() on objects and functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%