UNPKG

572 BJavaScriptView Raw
1"use strict";
2/**
3 * @author: JP Lew (jp@cto.ai)
4 * @date: Tuesday, 23rd April 2019 11:05:01 pm
5 * @lastModifiedBy: JP Lew (jp@cto.ai)
6 * @lastModifiedTime: Wednesday, 24th April 2019 12:45:12 pm
7 * @copyright (c) 2019 CTO.ai
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10// based on https://github.com/obengwilliam/pipeawait
11const asyncPipe = (...fns) => (param) => fns.reduce(async (acc, fn) => fn(await acc), param);
12exports.asyncPipe = asyncPipe;
13const _trace = (msg) => (x) => {
14 console.log(msg, x);
15 return x;
16};
17exports._trace = _trace;