//#region src/Array/firstOr.d.ts /** * # firstOr * * ```ts * function Array.firstOr( * target: readonly T[], * or: U, * ): Exclude | U * ``` * * Returns the first element of `array`, or `fallback` if the array is empty. * * ## Example * * ```ts [data-first] * import { Array } from "@monstermann/array"; * * Array.firstOr([1, 2, 3, 4], 0); // 1 * ``` * * ```ts [data-last] * import { Array } from "@monstermann/array"; * * pipe([1, 2, 3, 4], Array.firstOr(0)); // 1 * ``` * */ declare const firstOr: { (or: U): (target: readonly T[]) => Exclude | U; (target: readonly T[], or: U): Exclude | U; }; //#endregion export { firstOr };