@metreeca/core - v0.9.19
    Preparing search index...

    Function seal

    Inspects or attaches sealed content on a value.

    • Retrieves the content sealed on value under the given seal.

      Type Parameters

      • T

        The expected type of the sealed content

      Parameters

      • value: unknown

        The value to inspect

      • seal: symbol

        The symbol identifying the seal

      Returns T | undefined

      The sealed content if value is sealed under seal; undefined otherwise

    • Seals content on value under the given seal.

      Both the sealed clone and any object or array content are deep-frozen and branded at every depth, so immutable returns them unchanged: the result, its members, the content, and the content members all keep a stable identity across calls.

      Type Parameters

      • V

        The type of the value being sealed

      Parameters

      • value: V

        The value to seal

      • seal: symbol

        The symbol identifying the seal

      • content: unknown

        The content to seal on value

      Returns V

      The sealed value