Demo for query storing
Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/node_modules/p-pipe/index.js b/node_modules/p-pipe/index.js
new file mode 100644
index 0000000..cbc7f49
--- /dev/null
+++ b/node_modules/p-pipe/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+// TODO: Use rest/spread when targeting Node.js 6
+
+module.exports = function (input) {
+ const args = Array.isArray(input) ? input : arguments;
+
+ if (args.length === 0) {
+ return Promise.reject(new Error('Expected at least one argument'));
+ }
+
+ return [].slice.call(args, 1).reduce((a, b) => {
+ return function () {
+ return Promise.resolve(a.apply(null, arguments)).then(b);
+ };
+ }, args[0]);
+};