Library API
    Preparing search index...

    Function Securable

    • A class decorator that secures a class instance with a mutation-throwing Proxy. Provides "noisy immutability" by throwing an error if modifications are attempted.

      Type Parameters

      Parameters

      • value: T

        The class constructor to secure

      • context: ClassDecoratorContext<T>

        The decorator context

      Returns void | T

      The secured class wrapper

      Workaround: To protect against aggressive bundlers (Rollup/Terser) mutating the TS 7.0 ES2022 decorator IIFE structure, users must append return Object.freeze(this) as this; (or the secure equivalent) to their constructors to ensure immutability survives production bundling.

      @Securable
      class Config { ... }