Hierarchy

  • Creates a Collection.

    The type of Collection created is based on the input.

    • If an Collection, that same Collection.
    • If an Array-like, an Collection.Indexed.
    • If an Object with an Iterator defined, an Collection.Indexed.
    • If an Object, an Collection.Keyed.

    This methods forces the conversion of Objects and Strings to Collections. If you want to ensure that a Collection of one item is returned, use Seq.of.

    Note: An Iterator itself will be treated as an object, becoming a Seq.Keyed, which is usually not what you want. You should turn your Iterator Object into an iterable object by defining a Symbol.iterator (or @@iterator) method which returns this.

    Note: Collection is a conversion function and not a class, and does not use the new keyword during construction.

    Type Parameters

    Parameters

    • collection: I

    Returns I

  • Type Parameters

    • T

    Parameters

    Returns <internal>.Indexed<T>

  • Type Parameters

    • V

    Parameters

    • obj: { [key: string]: V }
      • [key: string]: V

    Returns <internal>.Collection.Keyed<string, V>

  • Type Parameters

    • K = unknown

    • V = unknown

    Returns <internal>.Collection<K, V>

Generated using TypeDoc