MultiLoader-Template/node_modules/es-toolkit/dist/array/takeRight.mjs
3944Realms 768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00

12 lines
286 B
JavaScript

import { toInteger } from '../compat/util/toInteger.mjs';
function takeRight(arr, count, guard) {
count = guard || count === undefined ? 1 : toInteger(count);
if (count <= 0 || arr.length === 0) {
return [];
}
return arr.slice(-count);
}
export { takeRight };