effect-io-ai

Package: effect
Module: Array

Array.fromOption

Converts an Option to an array.

Example

import { Array, Option } from "effect"

console.log(Array.fromOption(Option.some(1))) // [1]
console.log(Array.fromOption(Option.none())) // []

Signature

declare const fromOption: <A>(self: Option.Option<A>) => Array<A>

Source

Since v2.0.0