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