Documentation - v7.16.0
    Preparing search index...

    Function detachToJsonMethod

    • Detaches the toJSON method from value (if present) and returns a restore function.

      This is used by jsonStringify and sanitize to prevent faulty toJSON overrides from interfering with serialization. The restore function re-attaches the original method.

      Parameters

      • value: object

        The object whose toJSON should be detached.

      Returns () => void

      A function that restores the original toJSON (or a no-op if none was present).