• Recursively freezes (Object.freeze) the object (or value). This method DOES NOT support cyclical data structures. This method DOES NOT support advanced object types like Set, Map, or other specialized classes.

    Type Parameters

    • const T extends object

    Parameters

    • obj: T

      The object (or value)

    • Optionaloptions: { strict?: boolean } = {}

      Options to configure the behaviour of deepFreeze

      • Optionalstrict?: boolean

        Throw an Error if deepFreeze is unable to seal something instead of returning the original

    Returns Readonly<T>

    The same object (or value) that was passed in