mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-09 13:26:08 +10:00
8 lines
240 B
JavaScript
8 lines
240 B
JavaScript
exports.compose = (...processors) => {
|
|
if (processors.length === 0) return input => input
|
|
if (processors.length === 1) return processors[0]
|
|
return processors.reduce((prev, next) => {
|
|
return (...args) => next(prev(...args))
|
|
})
|
|
}
|