import predicateType from '../helpers/predicateType'; /** * Creates a new array containing the elements of the input array, up until the predicate returns false. * * @template T * @param {T[]} array - The input array. * @param {Function} [predicate=identity] - The predicate function to be called on each element. * @returns {T[]} - The new array of elements that passed the predicate, until the first that returned false. * * @example * * takeWhile([1, 2, 3, 4], n => n < 3); * // => [1, 2] * * takeWhile(['cat', 'dog', 'emu'], animal => animal.length <= 3); * // => ['cat', 'dog'] */ declare const takeWhile: (array: T[], predicate?: predicateType) => T[]; export default takeWhile;