seti-ramesesv1
Version:
Reusable components and context for Next.js apps
34 lines (27 loc) • 655 B
JavaScript
import { sizeof } from './Utility.js';
/**
* @param {function[]} collection
* @return {function}
*/
function middleware (collection) {
var length = sizeof(collection);
return function (element, index, children, callback) {
var output = '';
for (var i = 0; i < length; i++)
output += collection[i](element, index, children, callback) || '';
return output
}
}
/**
* @param {function} callback
* @return {function}
*/
function rulesheet (callback) {
return function (element) {
if (!element.root)
if (element = element.return)
callback(element);
}
}
export { middleware, rulesheet };
//# sourceMappingURL=Middleware.js.map