@metreeca/core - v0.9.22
    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 an array of T

      Returns readonly T[]

      An array holding the given values: empty if values is undefined, a single-element array if values is a bare T, or values itself if it is already an array