Class UcAttr<T>

Default typed charge metadata attribute implementation.

Stores all values added to metadata as array. Extracts the latest one as single attribute value.

Type Parameters

  • out T = unknown

    Attribute value type.

Hierarchy

Constructors

Accessors

Methods

Constructors

Accessors

Methods

  • Extracts attribute value from metadata.

    Parameters

    • data: undefined | T[]

      Stored attribute data or undefined if nothing stored.

    • meta: UcMeta

      Source metadata to extract the value from.

    Returns undefined | T

    Either extracted attribute value, or undefined if nothing extracted.

  • Extracts all attribute values.

    Parameters

    • data: undefined | T[]

      Stored attribute data or undefined if nothing stored.

    • meta: UcMeta

      Source metadata to extract values from.

    Returns T[]

    Either array of extracted attribute values, or empty array if nothing extracted.

  • Merges two attribute data instances.

    Called when metadata instances merged.

    Parameters

    • first: T[]

      First attribute data instance to merge.

    • second: T[]

      Second attribute data instance to merge.

    Returns T[]

    Merged attribute data.

  • Stores attribute value to metadata.

    Parameters

    • data: undefined | T[]

      Already stored attribute data or undefined if nothing stored yet.

    • value: T

      The input value to store.

    • meta: UcMeta

      Target metadata to store the value in.

    Returns T[]

    Value to store.

Generated using TypeDoc