parent
fce13afbf6
commit
8894f26ce2
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user