Library API
    Preparing search index...

    Function secure

    • Deep-freezes an object and wraps it in a loudly-throwing read-only Proxy. Provides the highest level of noisy immutability.

      Type Parameters

      • const T extends object

      Parameters

      • obj: T

        The object to secure

      • skip: WeakSet<object> = ...

        A WeakSet of objects to skip during deep-freeze

      Returns T

      The securely frozen Proxy

      const safe = secure({ apiKey: '123' });