This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/es-toolkit/dist/function/rest.mjs
T

13 lines
349 B
JavaScript

function rest(func, startIndex = func.length - 1) {
return function (...args) {
const rest = args.slice(startIndex);
const params = args.slice(0, startIndex);
while (params.length < startIndex) {
params.push(undefined);
}
return func.apply(this, [...params, rest]);
};
}
export { rest };