UNPKG

@datorama/akita

Version:

A Reactive State Management Tailored-Made for JS Applications

17 lines 629 B
// @internal export function deepFreeze(o) { Object.freeze(o); const oIsFunction = typeof o === 'function'; const hasOwnProp = Object.prototype.hasOwnProperty; Object.getOwnPropertyNames(o).forEach(function (prop) { if (hasOwnProp.call(o, prop) && (oIsFunction ? prop !== 'caller' && prop !== 'callee' && prop !== 'arguments' : true) && o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop])) { deepFreeze(o[prop]); } }); return o; } //# sourceMappingURL=deepFreeze.js.map