Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "freeze"

Index

Interfaces

Variables

Functions

Variables

Const valid

valid: boolean = ((() => {try {const o: ITest = Object.freeze({ a: 1 });const s = new Set<ITest>([o]);return !!s.size;} catch {return false;}})())

Functions

freeze

  • freeze<K, V>(a: Map<K, V>): ReadonlyMap<K, V>
  • freeze<T>(a: Set<T>): ReadonlySet<T>
  • freeze<T>(a: Array<T>): ReadonlyArray<T>
  • freeze<T>(f: T): T
  • freeze<T>(o: T): Readonly<T>
  • Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

    Type parameters

    • K

    • V

    Parameters

    • a: Map<K, V>

    Returns ReadonlyMap<K, V>

    the frozen object

  • Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

    Type parameters

    • T

    Parameters

    • a: Set<T>

    Returns ReadonlySet<T>

    the frozen object

  • Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

    Type parameters

    • T

    Parameters

    • a: Array<T>

    Returns ReadonlyArray<T>

    the frozen object

  • Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

    Type parameters

    • T: Function

    Parameters

    • f: T

    Returns T

    the frozen object

  • Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

    Type parameters

    • T

    Parameters

    • o: T

      Object on which to lock the attributes

    Returns Readonly<T>

    the frozen object