//#region src/Array/findOr.d.ts /** * # findOr * * ```ts * function Array.findOr( * target: readonly T[], * predicate: ( * value: NoInfer, * index: number, * target: readonly NoInfer[], * ) => boolean, * or: V, * ): Exclude | V * ``` * * Returns the first element in `array` that satisfies the provided `predicate` function, or `fallback` if no element is found. * * ## Example * * ```ts [data-first] * import { Array } from "@monstermann/array"; * * Array.findOr([1, 2, 3, 4], (x) => x > 10, 0); // 0 * ``` * * ```ts [data-last] * import { Array } from "@monstermann/array"; * * pipe( * [1, 2, 3, 4], * Array.findOr((x) => x > 10, 0), * ); // 0 * ``` * */ declare const findOr: { (predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => value is U, or: V): (target: readonly T[]) => Exclude | V; (predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => boolean, or: V): (target: readonly T[]) => Exclude | V; (target: readonly T[], predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => value is U, or: V): Exclude | V; (target: readonly T[], predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => boolean, or: V): Exclude | V; }; //#endregion export { findOr };