deep-freeze.js 387 B

123456789101112
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const is_1 = require("@sindresorhus/is");
  4. function deepFreeze(object) {
  5. for (const value of Object.values(object)) {
  6. if (is_1.default.plainObject(value) || is_1.default.array(value)) {
  7. deepFreeze(value);
  8. }
  9. }
  10. return Object.freeze(object);
  11. }
  12. exports.default = deepFreeze;