Files
cannaiq/frontend/node_modules/es-toolkit/dist/function/rest.js
2025-11-28 19:45:44 -07:00

17 lines
442 B
JavaScript

'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
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]);
};
}
exports.rest = rest;