ts-prime
Version:
A utility library for JavaScript and Typescript.
20 lines • 670 B
TypeScript
import { LazyResult } from './_reduceLazy';
/**
* Returns the first `n` elements of `array`.
* @param array the array
* @param n the number of elements to take
* @signature
* P.take(array, n)
* @signature
* P.take(n)(array)
* @example
* P.take([1, 2, 3, 4, 3, 2, 1], 3) // => [1, 2, 3]
* P.pipe([1, 2, 3, 4, 3, 2, 1], P.take(n)) // => [1, 2, 3]
* @category Array, Pipe
*/
export declare function take<T>(array: readonly T[], n: number): T[];
export declare function take<T>(n: number): (array: readonly T[]) => T[];
export declare namespace take {
function lazy<T>(n: number): (value: T) => LazyResult<T>;
}
//# sourceMappingURL=take.d.ts.map