@kermank/slots
Version:
A TypeScript library for handling time slots, scheduling, and timezone operations
18 lines (17 loc) • 521 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.composeOperators = composeOperators;
/**
* Compose multiple slot operators into one
*/
function composeOperators(...operators) {
return (slots) => {
for (const operator of operators) {
const result = operator(slots);
if (result.error)
return result;
slots = result.data; // Safe because we know operators return Slot[]
}
return { data: slots };
};
}