/** * Applies an array of decorators to a given function in a right-to-left order. * * @param {Function[]} decorators - An array of decorator functions to apply. * @param {Function} func - The original function to decorate. * @returns {Function} - The decorated function after applying all the decorators. */ export function applyDecorators(decorators, func) { return decorators.reduceRight((acc, dec) => dec(acc), func); }