Class RecordAbstract

Hierarchy

Implements

Properties

fieldCount: number

Returns the number of [[Field]] members contained in this Record.

Accessors

  • get key(): Value
  • Always returns [[Absent]] because a Value can't be a Field, so it can't have a key component.

    Returns Value

  • get length(): number
  • Returns the number of members contained in this Record.

    Returns number

  • get tag(): string
  • Returns the key string of the first member of this Record, if the first member is an [[Attr]]; otherwise returns undefined if the first member is not an Attr.

    Used to concisely get the name of the discriminating attribute of a structure. The tag can be used to discern the nominal type of a polymorphic structure, similar to an XML element tag.

    Returns string

  • get target(): Value
  • Returns the [[Record.flattened flattened]] members of this Record after all attributes have been removed.

    Used to concisely get the scalar value of an attributed structure. An attributed structure is a Record with one or more attributes that modify one or more other members.

    Returns Value

  • get typeOrder(): number
  • Returns the heterogeneous sort order of this Item. Used to impose a total order on the set of all items. When comparing two items of different types, the items order according to their typeOrder.

    Returns number

  • get valueCount(): number
  • Returns the number of [[Value]] members contained in this Record.

    Returns number

Methods

  • Returns Cursor<Item>

  • Returns void

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    Returns Record

  • Parameters

    Returns Record

  • Returns Value

  • Returns the [[Record.flattened flattened]] [[Record.tail tail]] of this Record. Used to recursively deconstruct a structure, terminating with its last Value, rather than a unary Record containing its last value, if the structure ends with a Value member.

    Returns Value

  • Converts this Value into a boolean value, if possible; otherwise returns undefined if this Value can't be converted into a boolean value.

    Returns boolean

  • Converts this Value into a boolean value, if possible; otherwise returns orElse if this Value can't be converted into a boolean value.

    Type Parameters

    • T

    Parameters

    • orElse: T

    Returns boolean | T

  • Returns Record

  • Returns Record

  • Type Parameters

    • T

    Parameters

    • form: Form<T, unknown>

    Returns T

  • Type Parameters

    • T

    • E = T

    Parameters

    • form: Form<T, unknown>
    • orElse: E

    Returns T | E

  • Returns void

  • Returns Record

  • Type Parameters

    • T

    Parameters

    • form: Form<T, unknown>

    Returns T

  • Type Parameters

    • T

    • E = T

    Parameters

    • form: Form<T, unknown>
    • orElse: E

    Returns T | E

  • Returns Record

  • Parameters

    • that: unknown

    Returns number

  • Parameters

    Returns Record

  • Type Parameters

    • T

    Parameters

    • output: Output<T>

    Returns Output<T>

  • Parameters

    Returns Item

  • Type Parameters

    • T

    Parameters

    • output: Output<T>

    Returns Output<T>

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    • that: unknown

    Returns boolean

  • Parameters

    • that: unknown
    • Optional epsilon: number

    Returns boolean

  • Returns the sole member of this Record, if this Record has exactly one member, and its member is a Value; returns [[Extant]] if this Record is empty; otherwise returns this if this Record has more than one member.

    Used to convert a unary Record into its member Value. Facilitates writing code that treats a unary Record equivalently to a bare Value.

    Returns Value

  • Type Parameters

    • T

    Parameters

    • callback: ((item, index) => void | T)
        • (item, index): void | T
        • Parameters

          • item: Item
          • index: number

          Returns void | T

    Returns T

  • Type Parameters

    • T

    • S

    Parameters

    • callback: ((this, item, index) => void | T)
        • (this, item, index): void | T
        • Parameters

          • this: S
          • item: Item
          • index: number

          Returns void | T

    • thisArg: S

    Returns T

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Returns the value of the last [[Field]] member of this Record whose key is equal to the given key; returns [[Absent]] if this Record has no Field member with a key equal to the given key.

    Parameters

    Returns Value

  • Returns the value of the last [[Attr]] member of this Record whose key is equal to the given key; returns [[Absent]] if this Record has no Attr member with a key equal to the given key.

    Parameters

    Returns Value

  • Returns the last [[Field]] member of this Record whose key is equal to the given key; returns undefined if this Record has no Field member with a key equal to the given key.

    Parameters

    Returns Field

  • Returns the member of this Record at the given index, if the index is greater than or equal to zero, and less than the [[Record.length length]] of this Record; otherwise returns [[Absent]] if the index is out of bounds.

    Parameters

    Returns Item

  • Returns the value of the last [[Slot]] member of this Record whose key is equal to the given key; returns [[Absent]] if this Record has no Slot member with a key equal to the given key.

    Parameters

    Returns Value

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Returns true if this Record has a [[Field]] member with a key that is equal to the given key; otherwise returns false if this Record has no Field member with a key equal to the given key.

    Parameters

    Returns boolean

  • Returns number

  • Returns the first member of this Record, if this Record is non-empty; otherwise returns [[Absent]].

    Returns Item

  • Returns the value of the first member of this Record, if the first member is an [[Attr]] whose key string is equal to tag; otherwise returns [[Absent]] if the first member of this Record is not an Attr, or if the first member of this Record is an Attr whose key does not equal the tag.

    Used to conditionally get the value of the head Attr of a structure, if and only if the key string of the head Attr is equal to the tag. Can be used to check if a structure might conform to a nominal type named tag, while simultaneously getting the value of the tag attribute.

    Parameters

    • tag: string

    Returns Value

  • Returns the [[Record.unflattened unflattened]] [[Record.header header]] of this Record. The headers of the tag attribute of a structure are like the attributes of an XML element tag; through unlike an XML element, tag attribute headers are not limited to string keys and values.

    Parameters

    • tag: string

    Returns Record

  • Parameters

    Returns number

  • Parameters

    Returns Interpolator<Record>

  • Parameters

    Returns Interpolator<Item>

  • Parameters

    • that: unknown

    Returns Interpolator<Item>

  • Returns Value

  • Parameters

    Returns Item

  • Returns boolean

  • Returns true if this Record has only [[Value]] members–no Field members.

    Returns boolean

  • Returns true if this Item always [[Item.evaluate evaluates]] to the same Item.

    Returns boolean

  • Returns true if this Value is not [[Absent]].

    Returns boolean

  • Returns true if this Value is not one of: an empty Record, False, Extant, or Absent.

    Returns boolean

  • Returns true if this Value is neither [[Extant]] nor [[Absent]].

    Returns boolean

  • Returns true if this Record has no members.

    Returns boolean

  • Returns boolean

  • Returns true if this Record has only [[Field]] members–no Value members.

    Returns boolean

  • Parameters

    Returns Record

  • Parameters

    Returns Record

  • Returns Cursor<Item>

  • Parameters

    • key: unknown

    Returns boolean

  • Parameters

    Returns Value

  • Parameters

    Returns number

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    Returns void

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    Returns Item

  • Parameters

    Returns Item

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Returns Value

  • Returns Value

  • Converts this Value into a number value, if possible; otherwise returns undefined if this Value can't be converted into a number value.

    Returns number

  • Converts this Value into a number value, if possible; otherwise returns orElse if this Value can't be converted into a number value.

    Type Parameters

    • T

    Parameters

    • orElse: T

    Returns number | T

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Returns Value

  • Parameters

    Returns number

  • Parameters

    Returns Record

  • Replaces the member of this Record at the given index with a new item, returning this Record, if the index is greater than or equal to zero, and less than the [[Record.length length]] of this Record.

    Parameters

    Returns Record

    Throws

    Error if this is an immutable Record.

    Throws

    RangeError if the index is out of bounds.

  • Parameters

    Returns Record

  • Parameters

    • Optional lower: number
    • Optional upper: number

    Returns Record

  • Parameters

    Returns Record

  • Parameters

    • start: number
    • Optional deleteCount: number
    • Rest ...newItems: ItemLike[]

    Returns Item[]

  • Converts this Value into a string value, if possible; otherwise returns undefined if this Value can't be converted into a string value.

    Returns string

  • Converts this Value into a string value, if possible; otherwise returns orElse if this Value can't be converted into a string value.

    Type Parameters

    • T

    Parameters

    • orElse: T

    Returns string | T

  • Parameters

    • Optional lower: number
    • Optional upper: number

    Returns Record

  • Returns a view of all but the first member of this Record, if this Record is non-empty; otherwise returns an empty Record, if this Record is itself empty.

    Returns Record

  • Parameters

    Returns Value

  • Parameters

    Returns Item

  • Returns ItemLike[]

  • Returns {
        [key: string]: ValueLike;
    }

  • Returns string

  • Always returns this because every Value is its own value component.

    Returns Value

  • Returns this Record.

    Returns Record

  • Returns Value

  • Returns Builder<Item, Value>

  • Parameters

    • Optional initialCapacity: number

    Returns Record

  • Returns Record

  • Returns Value

  • Parameters

    • array: {
          length?: number;
          [index: number]: ItemLike;
      }
      • [index: number]: ItemLike
      • Optional length?: number

    Returns Record

  • Parameters

    Returns Record

  • Returns Item

  • Parameters

    Returns Record

Generated using TypeDoc