shapeup.js
function deepFreeze(obj) {
  Object.freeze(obj);
  forEachKeyValue(obj, (name, prop) => {
    const type = typeof obj;
    if (
      prop !== null &&
      (type === 'object' || type === 'function') &&
      !Object.isFrozen(prop)
    ) {
      deepFreeze(prop);
    }
  });
  return obj;
}
function deepFreeze(obj) {
  Object.freeze(obj);
  forEachKeyValue(obj, (name, prop) => {
    const type = typeof obj;
    if (
      prop !== null &&
      (type === 'object' || type === 'function') &&
      !Object.isFrozen(prop)
    ) {
      deepFreeze(prop);
    }
  });
  return obj;
}
function deepFreeze ( obj ) { Object . freeze ( obj ) ; forEachKeyValue ( obj , ( name , prop ) => { const type = typeof obj ; if ( prop !== null && ( type === 'object' || type === 'function' ) && ! Object . isFrozen ( prop ) ) { deepFreeze ( prop ) ; } } ) ; return obj ; }
Deep freeze the given object and all its properties.

@param {Object} obj The object to freeze.
@returns {Object} The resulting deeply frozen object.
Deep freeze the given object and all its properties .