src/common/storage/project/cache.js
function deepFreeze(obj) {
            Object.freeze(obj);

            if (obj instanceof Array) {
                for (var i = 0; i < obj.length; i += 1) {
                    if (obj[i] !== null && typeof obj[i] === 'object') {
                        deepFreeze(obj[i]);
                    }
                }
            } else {
                for (var key in obj) {
                    if (obj[key] !== null && typeof obj[key] === 'object') {
                        deepFreeze(obj[key]);
                    }
                }
            }
        }
function deepFreeze(obj) {
            Object.freeze(obj);

            if (obj instanceof Array) {
                for (var i = 0; i < obj.length; i += 1) {
                    if (obj[i] !== null && typeof obj[i] === 'object') {
                        deepFreeze(obj[i]);
                    }
                }
            } else {
                for (var key in obj) {
                    if (obj[key] !== null && typeof obj[key] === 'object') {
                        deepFreeze(obj[key]);
                    }
                }
            }
        }
function deepFreeze ( obj ) { Object . freeze ( obj ) ; if ( obj instanceof Array ) { for ( var i = 0 ; i < obj . length ; i += 1 ) { if ( obj [ i ] !== null && typeof obj [ i ] === 'object' ) { deepFreeze ( obj [ i ] ) ; } } } else { for ( var key in obj ) { if ( obj [ key ] !== null && typeof obj [ key ] === 'object' ) { deepFreeze ( obj [ key ] ) ; } } } }
Useful for debugging potential mutations, but not good for performance.
Useful for debugging potential mutations but not good for performance .