Function deepFreeze

  • Recursively freezes an objects and all own non-function sub-objects.

    Note that the input object is being mutated.

    Since

    12.0.0

    See

    • deepSeal
    • Object.freeze

    Example

    const a = {a: {b: 2}, b: [1, {foo: "foo"}], c: 2};

    deepFreeze(a)
    // => object and all sub-objects are frozen.

    Parameters

    • object: object

      Object to recursively freeze.

    Returns void

Generated using TypeDoc