code: function deepFreeze(o) {
    Object.freeze(o)
    Object.getOwnPropertyNames(o).forEach(function(prop) {
      if (
        o[prop] !== null &&
        (typeof o[prop] === "object" || typeof o[prop] === "function") &&
        !Object.isFrozen(o[prop])
      ) {
        deepFreeze(o[prop])
      }
    })
    return o
  }
docs: Based on deep-freeze by substack (public domain)