diff --git a/lib/freeze.js b/lib/freeze.js index 8d88d80..c273ed7 100644 --- a/lib/freeze.js +++ b/lib/freeze.js @@ -26,7 +26,10 @@ function recur(object) { * Deeply freeze a plain javascript object. * * If `process.env.NODE_ENV === 'production'`, this returns the original object - * witout freezing. + * without freezing. + * + * Or if `process.env.UPDEEP_MODE === 'dangerously_never_freeze'`, this returns the original object + * without freezing. * * @function * @sig a -> a @@ -38,6 +41,10 @@ function freeze(object) { return object; } + if (process.env.UPDEEP_MODE === 'dangerously_never_freeze') { + return object; + } + if (needsFreezing(object)) { recur(object); }