aboutsummaryrefslogtreecommitdiff
path: root/node_modules/got/dist/source/utils/deep-freeze.js
blob: a696d4efb9a1764256ae868222eecdc34fac21b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const is_1 = require("@sindresorhus/is");
function deepFreeze(object) {
    for (const value of Object.values(object)) {
        if (is_1.default.plainObject(value) || is_1.default.array(value)) {
            deepFreeze(value);
        }
    }
    return Object.freeze(object);
}
exports.default = deepFreeze;