Function createImmutableArray

  • Creates a read-only proxy for an array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to make read-only.

    • additionalErrorMessage: string = ''

      An additional error message to include in the error thrown when a mutation method is called.

    Returns T[]

    A read-only proxy for the array.