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

    Function some

    • Normalises a Some value into an array.

      Coerces an optional or single-or-many value into a uniform array, so callers accepting flexible input can iterate over the result without branching on its shape.

      Type Parameters

      • T

        The type of the contained values

      Parameters

      • values: Some<T>

        The value to normalise: undefined, a single T, or a collection of T drawn from exactly once, so single-pass iterators are safe to pass

      Returns readonly T[]

      An array holding the given values: empty if values is undefined, a single-element array if values is a bare T, values itself if it is already an array, or its elements collected in iteration order otherwise