NeahNew/node_modules/hot-patcher/dist/functions.js
2025-05-03 14:17:46 +02:00

15 lines
435 B
JavaScript

export function sequence(...methods) {
if (methods.length === 0) {
throw new Error("Failed creating sequence: No functions provided");
}
return function __executeSequence(...args) {
let result = args;
const _this = this;
while (methods.length > 0) {
const method = methods.shift();
result = [method.apply(_this, result)];
}
return result[0];
};
}