Options
All
  • Public
  • Public/Protected
  • All
Menu

A type of Set that has the additional guarantee that the iteration order of values will be the order in which they were added.

The iteration behavior of OrderedSet is the same as native ES6 Set.

Note that OrderedSet are more expensive than non-ordered Set and may consume more memory. OrderedSet#add is amortized O(log32 N), but not stable.

Index

Functions

  • OrderedSet.fromKeys() creates a new immutable OrderedSet containing the keys from this Collection or JavaScript Object.

    Type parameters

    • T

    Parameters

    Returns <internal>.OrderedSet<T>

  • Parameters

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

    Returns <internal>.OrderedSet<string>

  • isOrderedSet(maybeOrderedSet: unknown): boolean
  • True if the provided value is an OrderedSet.

    Parameters

    • maybeOrderedSet: unknown

    Returns boolean

  • Creates a new OrderedSet containing values.

    Type parameters

    • T

    Parameters

    • Rest ...values: T[]

    Returns <internal>.OrderedSet<T>

Generated using TypeDoc