LendAndRegret/node_modules/es-toolkit/dist/array/take.mjs
2026-05-02 17:27:43 +08:00

9 lines
211 B
JavaScript

import { toInteger } from '../compat/util/toInteger.mjs';
function take(arr, count, guard) {
count = guard || count === undefined ? 1 : toInteger(count);
return arr.slice(0, count);
}
export { take };