aboutsummaryrefslogtreecommitdiff
path: root/node_modules/vuepress/lib/util/shared.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/vuepress/lib/util/shared.js')
-rw-r--r--node_modules/vuepress/lib/util/shared.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/node_modules/vuepress/lib/util/shared.js b/node_modules/vuepress/lib/util/shared.js
new file mode 100644
index 00000000..023f63bd
--- /dev/null
+++ b/node_modules/vuepress/lib/util/shared.js
@@ -0,0 +1,7 @@
+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))
+ })
+}