Freeze does nothing if process is undefined
This commit is contained in:
parent
4b5032e101
commit
fb4f674d7f
@ -32,12 +32,18 @@ function recur(object) {
|
||||
* Or if `process.env.UPDEEP_MODE === 'dangerously_never_freeze'`, this returns the original object
|
||||
* without freezing.
|
||||
*
|
||||
* If in a browser and built without replacing process, never freeze.
|
||||
*
|
||||
* @function
|
||||
* @sig a -> a
|
||||
* @param {object} object Object to freeze.
|
||||
* @return {object} Frozen object, unless in production, then the same object.
|
||||
*/
|
||||
function freeze(object) {
|
||||
if (typeof process === 'undefined') {
|
||||
return object
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return object
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user