Function Graph Overview
    Preparing search index...

    Function maybe

    • Converts an optional value to an array, handling undefined cases.

      Type Parameters

      • T

        The type of the input value

      Parameters

      • value: undefined | T

        Optional input value

      Returns T[]

      An array containing the value, or an empty array if undefined

      maybe(5)       // [5]
      maybe(undefined) // []