recursively Object.freeze() on objects and functions
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
example readme and example Sep 4, 2012
test passing test Sep 4, 2012
.travis.yml using travis Sep 4, 2012
LICENSE package.json etc Sep 4, 2012
index.js return the frozen object Sep 4, 2012
package.json return the frozen object Sep 4, 2012
readme.markdown using travis Sep 4, 2012

readme.markdown

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.