Library API
    Preparing search index...

    Function proxify

    • Creates a Stealth Proxy pattern to allow for on-demand lazy property discovery and registration. Provides deep-freezing and bounding capabilities depending on options.

      Type Parameters

      • T extends object

      Parameters

      • target: T

        The object to proxify

      • Optionalmode: "readonly" | "frozen"

        Immutability mode ('frozen' by default)

      • Optionalskip: WeakSet<object>

        A WeakSet of objects to skip during deep-freeze

      Returns Readonly<T>

      The proxified object

      const p = proxify({ a: 1 });
      const r = proxify({ a: 1 }, 'readonly');
    • Creates a Stealth Proxy pattern to allow for on-demand lazy property discovery and registration. Provides deep-freezing and bounding capabilities depending on options.

      Type Parameters

      • T extends object

      Parameters

      • target: T

        The object to proxify

      • mode: "mutable"

        Immutability mode ('frozen' by default)

      • Optionalskip: WeakSet<object>

        A WeakSet of objects to skip during deep-freeze

      Returns T

      The proxified object

      const p = proxify({ a: 1 });
      const r = proxify({ a: 1 }, 'readonly');
    • Creates a Stealth Proxy pattern to allow for on-demand lazy property discovery and registration. Provides deep-freezing and bounding capabilities depending on options.

      Type Parameters

      • T extends object

      Parameters

      • target: T

        The object to proxify

      • Optionalmode: ProxyMode

        Immutability mode ('frozen' by default)

      • Optionalskip: WeakSet<object>

        A WeakSet of objects to skip during deep-freeze

      Returns T | Readonly<T>

      The proxified object

      const p = proxify({ a: 1 });
      const r = proxify({ a: 1 }, 'readonly');