@modern-js/plugin 1.21.2-beta.0 → 1.21.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/modern/farrow-pipeline/context.js +38 -0
 - package/dist/js/modern/farrow-pipeline/counter.js +18 -0
 - package/dist/js/modern/farrow-pipeline/index.js +5 -0
 - package/dist/js/modern/farrow-pipeline/pipeline.js +76 -0
 - package/dist/js/modern/index.js +4 -0
 - package/dist/js/modern/manager/async.js +112 -0
 - package/dist/js/modern/manager/index.js +3 -0
 - package/dist/js/modern/manager/shared.js +44 -0
 - package/dist/js/modern/manager/sync.js +188 -0
 - package/dist/js/modern/manager/types.js +0 -0
 - package/dist/js/modern/waterfall/async.js +47 -0
 - package/dist/js/modern/waterfall/index.js +2 -0
 - package/dist/js/modern/waterfall/sync.js +47 -0
 - package/dist/js/modern/workflow/async.js +43 -0
 - package/dist/js/modern/workflow/index.js +3 -0
 - package/dist/js/modern/workflow/parallel.js +31 -0
 - package/dist/js/modern/workflow/sync.js +34 -0
 - package/dist/js/node/farrow-pipeline/context.js +47 -0
 - package/dist/js/node/farrow-pipeline/counter.js +27 -0
 - package/dist/js/node/farrow-pipeline/index.js +18 -0
 - package/dist/js/node/farrow-pipeline/pipeline.js +94 -0
 - package/dist/js/node/index.js +57 -0
 - package/dist/js/node/manager/async.js +124 -0
 - package/dist/js/node/manager/index.js +44 -0
 - package/dist/js/node/manager/shared.js +64 -0
 - package/dist/js/node/manager/sync.js +212 -0
 - package/dist/js/node/manager/types.js +0 -0
 - package/dist/js/node/waterfall/async.js +64 -0
 - package/dist/js/node/waterfall/index.js +31 -0
 - package/dist/js/node/waterfall/sync.js +64 -0
 - package/dist/js/node/workflow/async.js +57 -0
 - package/dist/js/node/workflow/index.js +44 -0
 - package/dist/js/node/workflow/parallel.js +45 -0
 - package/dist/js/node/workflow/sync.js +48 -0
 - package/dist/js/treeshaking/farrow-pipeline/context.js +42 -0
 - package/dist/js/treeshaking/farrow-pipeline/counter.js +23 -0
 - package/dist/js/treeshaking/farrow-pipeline/index.js +5 -0
 - package/dist/js/treeshaking/farrow-pipeline/pipeline.js +81 -0
 - package/dist/js/treeshaking/index.js +4 -0
 - package/dist/js/treeshaking/manager/async.js +146 -0
 - package/dist/js/treeshaking/manager/index.js +3 -0
 - package/dist/js/treeshaking/manager/shared.js +79 -0
 - package/dist/js/treeshaking/manager/sync.js +216 -0
 - package/dist/js/treeshaking/manager/types.js +0 -0
 - package/dist/js/treeshaking/waterfall/async.js +84 -0
 - package/dist/js/treeshaking/waterfall/index.js +2 -0
 - package/dist/js/treeshaking/waterfall/sync.js +59 -0
 - package/dist/js/treeshaking/workflow/async.js +108 -0
 - package/dist/js/treeshaking/workflow/index.js +3 -0
 - package/dist/js/treeshaking/workflow/parallel.js +62 -0
 - package/dist/js/treeshaking/workflow/sync.js +42 -0
 - package/dist/types/farrow-pipeline/context.d.ts +13 -0
 - package/dist/types/farrow-pipeline/counter.d.ts +11 -0
 - package/dist/types/farrow-pipeline/index.d.ts +5 -0
 - package/dist/types/farrow-pipeline/pipeline.d.ts +29 -0
 - package/dist/types/index.d.ts +4 -0
 - package/dist/types/manager/async.d.ts +63 -0
 - package/dist/types/manager/index.d.ts +3 -0
 - package/dist/types/manager/shared.d.ts +12 -0
 - package/dist/types/manager/sync.d.ts +75 -0
 - package/dist/types/manager/types.d.ts +36 -0
 - package/dist/types/waterfall/async.d.ts +21 -0
 - package/dist/types/waterfall/index.d.ts +2 -0
 - package/dist/types/waterfall/sync.d.ts +20 -0
 - package/dist/types/workflow/async.d.ts +12 -0
 - package/dist/types/workflow/index.d.ts +3 -0
 - package/dist/types/workflow/parallel.d.ts +10 -0
 - package/dist/types/workflow/sync.d.ts +11 -0
 - package/package.json +2 -2
 
| 
         @@ -0,0 +1,212 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
            exports.generateRunner = exports.createManager = exports.cloneHooksMap = exports.cloneHook = exports.DEFAULT_OPTIONS = void 0;
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            var _farrowPipeline = require("../farrow-pipeline");
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            var _waterfall = require("../waterfall");
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            var _workflow = require("../workflow");
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            var _shared = require("./shared");
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            const SYNC_PLUGIN_SYMBOL = 'SYNC_PLUGIN_SYMBOL';
         
     | 
| 
      
 23 
     | 
    
         
            +
            const DEFAULT_OPTIONS = {
         
     | 
| 
      
 24 
     | 
    
         
            +
              name: 'untitled',
         
     | 
| 
      
 25 
     | 
    
         
            +
              pre: [],
         
     | 
| 
      
 26 
     | 
    
         
            +
              post: [],
         
     | 
| 
      
 27 
     | 
    
         
            +
              rivals: [],
         
     | 
| 
      
 28 
     | 
    
         
            +
              required: [],
         
     | 
| 
      
 29 
     | 
    
         
            +
              usePlugins: [],
         
     | 
| 
      
 30 
     | 
    
         
            +
              registerHook: {}
         
     | 
| 
      
 31 
     | 
    
         
            +
            };
         
     | 
| 
      
 32 
     | 
    
         
            +
            exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            const createManager = (hooks, api) => {
         
     | 
| 
      
 35 
     | 
    
         
            +
              let index = 0;
         
     | 
| 
      
 36 
     | 
    
         
            +
              let runners;
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              let currentHooks = _objectSpread({}, hooks);
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              const useRunner = () => runners;
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              const registerHook = extraHooks => {
         
     | 
| 
      
 43 
     | 
    
         
            +
                currentHooks = _objectSpread(_objectSpread({}, extraHooks), currentHooks);
         
     | 
| 
      
 44 
     | 
    
         
            +
              };
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
              const isPlugin = input => (0, _shared.isObject)(input) && (0, _shared.hasOwnProperty)(input, SYNC_PLUGIN_SYMBOL) && input[SYNC_PLUGIN_SYMBOL] === SYNC_PLUGIN_SYMBOL;
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              const pluginAPI = _objectSpread(_objectSpread({}, api), {}, {
         
     | 
| 
      
 49 
     | 
    
         
            +
                useHookRunners: useRunner
         
     | 
| 
      
 50 
     | 
    
         
            +
              });
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
              const clone = overrideAPI => {
         
     | 
| 
      
 53 
     | 
    
         
            +
                let plugins = [];
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                const addPlugin = plugin => {
         
     | 
| 
      
 56 
     | 
    
         
            +
                  if (!(0, _shared.includePlugin)(plugins, plugin)) {
         
     | 
| 
      
 57 
     | 
    
         
            +
                    plugins.push(_objectSpread({}, plugin));
         
     | 
| 
      
 58 
     | 
    
         
            +
                  }
         
     | 
| 
      
 59 
     | 
    
         
            +
                };
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                const usePlugin = (...input) => {
         
     | 
| 
      
 62 
     | 
    
         
            +
                  input.forEach(plugin => {
         
     | 
| 
      
 63 
     | 
    
         
            +
                    // already created by createPlugin
         
     | 
| 
      
 64 
     | 
    
         
            +
                    if (isPlugin(plugin)) {
         
     | 
| 
      
 65 
     | 
    
         
            +
                      addPlugin(plugin);
         
     | 
| 
      
 66 
     | 
    
         
            +
                    } // using function to return plugin options
         
     | 
| 
      
 67 
     | 
    
         
            +
                    else if (typeof plugin === 'function') {
         
     | 
| 
      
 68 
     | 
    
         
            +
                      const options = plugin();
         
     | 
| 
      
 69 
     | 
    
         
            +
                      addPlugin(createPlugin(options.setup, options));
         
     | 
| 
      
 70 
     | 
    
         
            +
                    } // plain plugin object
         
     | 
| 
      
 71 
     | 
    
         
            +
                    else if ((0, _shared.isObject)(plugin)) {
         
     | 
| 
      
 72 
     | 
    
         
            +
                      addPlugin(createPlugin(plugin.setup, plugin));
         
     | 
| 
      
 73 
     | 
    
         
            +
                    } // unknown plugin
         
     | 
| 
      
 74 
     | 
    
         
            +
                    else {
         
     | 
| 
      
 75 
     | 
    
         
            +
                      console.warn(`Unknown plugin: ${JSON.stringify(plugin)}`);
         
     | 
| 
      
 76 
     | 
    
         
            +
                    }
         
     | 
| 
      
 77 
     | 
    
         
            +
                  });
         
     | 
| 
      
 78 
     | 
    
         
            +
                  return manager;
         
     | 
| 
      
 79 
     | 
    
         
            +
                };
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                const createPlugin = ( // eslint-disable-next-line @typescript-eslint/no-empty-function
         
     | 
| 
      
 82 
     | 
    
         
            +
                setup = () => {}, options = {}) => {
         
     | 
| 
      
 83 
     | 
    
         
            +
                  var _options$usePlugins;
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                  if ((_options$usePlugins = options.usePlugins) !== null && _options$usePlugins !== void 0 && _options$usePlugins.length) {
         
     | 
| 
      
 86 
     | 
    
         
            +
                    options.usePlugins.forEach(plugin => {
         
     | 
| 
      
 87 
     | 
    
         
            +
                      usePlugin(createPlugin(plugin.setup, plugin));
         
     | 
| 
      
 88 
     | 
    
         
            +
                    });
         
     | 
| 
      
 89 
     | 
    
         
            +
                  }
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                  if (options.registerHook) {
         
     | 
| 
      
 92 
     | 
    
         
            +
                    registerHook(options.registerHook);
         
     | 
| 
      
 93 
     | 
    
         
            +
                  }
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
                  return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_OPTIONS), {}, {
         
     | 
| 
      
 96 
     | 
    
         
            +
                    name: `No.${index++} plugin`
         
     | 
| 
      
 97 
     | 
    
         
            +
                  }, options), {}, {
         
     | 
| 
      
 98 
     | 
    
         
            +
                    SYNC_PLUGIN_SYMBOL,
         
     | 
| 
      
 99 
     | 
    
         
            +
                    setup
         
     | 
| 
      
 100 
     | 
    
         
            +
                  });
         
     | 
| 
      
 101 
     | 
    
         
            +
                };
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
                const clear = () => {
         
     | 
| 
      
 104 
     | 
    
         
            +
                  plugins = [];
         
     | 
| 
      
 105 
     | 
    
         
            +
                };
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
                const init = () => {
         
     | 
| 
      
 108 
     | 
    
         
            +
                  const sortedPlugins = (0, _shared.sortPlugins)(plugins);
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                  const mergedPluginAPI = _objectSpread(_objectSpread({}, pluginAPI), overrideAPI);
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                  (0, _shared.checkPlugins)(sortedPlugins);
         
     | 
| 
      
 113 
     | 
    
         
            +
                  const hooksList = sortedPlugins.map(plugin => plugin.setup(mergedPluginAPI));
         
     | 
| 
      
 114 
     | 
    
         
            +
                  runners = generateRunner(hooksList, currentHooks);
         
     | 
| 
      
 115 
     | 
    
         
            +
                  return runners;
         
     | 
| 
      
 116 
     | 
    
         
            +
                };
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
                const run = cb => cb();
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
                const manager = {
         
     | 
| 
      
 121 
     | 
    
         
            +
                  createPlugin,
         
     | 
| 
      
 122 
     | 
    
         
            +
                  isPlugin,
         
     | 
| 
      
 123 
     | 
    
         
            +
                  usePlugin,
         
     | 
| 
      
 124 
     | 
    
         
            +
                  init,
         
     | 
| 
      
 125 
     | 
    
         
            +
                  clear,
         
     | 
| 
      
 126 
     | 
    
         
            +
                  run,
         
     | 
| 
      
 127 
     | 
    
         
            +
                  registerHook,
         
     | 
| 
      
 128 
     | 
    
         
            +
                  useRunner,
         
     | 
| 
      
 129 
     | 
    
         
            +
                  clone
         
     | 
| 
      
 130 
     | 
    
         
            +
                };
         
     | 
| 
      
 131 
     | 
    
         
            +
                return manager;
         
     | 
| 
      
 132 
     | 
    
         
            +
              };
         
     | 
| 
      
 133 
     | 
    
         
            +
             
     | 
| 
      
 134 
     | 
    
         
            +
              return clone();
         
     | 
| 
      
 135 
     | 
    
         
            +
            };
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
      
 137 
     | 
    
         
            +
            exports.createManager = createManager;
         
     | 
| 
      
 138 
     | 
    
         
            +
             
     | 
| 
      
 139 
     | 
    
         
            +
            const generateRunner = (hooksList, hooksMap) => {
         
     | 
| 
      
 140 
     | 
    
         
            +
              const runner = {};
         
     | 
| 
      
 141 
     | 
    
         
            +
              const cloneShape = cloneHooksMap(hooksMap);
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
              if (hooksMap) {
         
     | 
| 
      
 144 
     | 
    
         
            +
                for (const key in cloneShape) {
         
     | 
| 
      
 145 
     | 
    
         
            +
                  for (const hooks of hooksList) {
         
     | 
| 
      
 146 
     | 
    
         
            +
                    if (!hooks) {
         
     | 
| 
      
 147 
     | 
    
         
            +
                      continue;
         
     | 
| 
      
 148 
     | 
    
         
            +
                    }
         
     | 
| 
      
 149 
     | 
    
         
            +
             
     | 
| 
      
 150 
     | 
    
         
            +
                    if (hooks[key]) {
         
     | 
| 
      
 151 
     | 
    
         
            +
                      cloneShape[key].use(hooks[key]);
         
     | 
| 
      
 152 
     | 
    
         
            +
                    }
         
     | 
| 
      
 153 
     | 
    
         
            +
                  } // eslint-disable-next-line @typescript-eslint/ban-ts-comment
         
     | 
| 
      
 154 
     | 
    
         
            +
                  // @ts-expect-error
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
      
 156 
     | 
    
         
            +
             
     | 
| 
      
 157 
     | 
    
         
            +
                  runner[key] = (input, options) => cloneShape[key].run(input, _objectSpread({}, options));
         
     | 
| 
      
 158 
     | 
    
         
            +
                }
         
     | 
| 
      
 159 
     | 
    
         
            +
              }
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
              return runner;
         
     | 
| 
      
 162 
     | 
    
         
            +
            };
         
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
            exports.generateRunner = generateRunner;
         
     | 
| 
      
 165 
     | 
    
         
            +
             
     | 
| 
      
 166 
     | 
    
         
            +
            const cloneHook = hook => {
         
     | 
| 
      
 167 
     | 
    
         
            +
              if ((0, _waterfall.isWaterfall)(hook)) {
         
     | 
| 
      
 168 
     | 
    
         
            +
                return (0, _waterfall.createWaterfall)();
         
     | 
| 
      
 169 
     | 
    
         
            +
              }
         
     | 
| 
      
 170 
     | 
    
         
            +
             
     | 
| 
      
 171 
     | 
    
         
            +
              if ((0, _waterfall.isAsyncWaterfall)(hook)) {
         
     | 
| 
      
 172 
     | 
    
         
            +
                return (0, _waterfall.createAsyncWaterfall)();
         
     | 
| 
      
 173 
     | 
    
         
            +
              }
         
     | 
| 
      
 174 
     | 
    
         
            +
             
     | 
| 
      
 175 
     | 
    
         
            +
              if ((0, _workflow.isWorkflow)(hook)) {
         
     | 
| 
      
 176 
     | 
    
         
            +
                return (0, _workflow.createWorkflow)();
         
     | 
| 
      
 177 
     | 
    
         
            +
              }
         
     | 
| 
      
 178 
     | 
    
         
            +
             
     | 
| 
      
 179 
     | 
    
         
            +
              if ((0, _workflow.isAsyncWorkflow)(hook)) {
         
     | 
| 
      
 180 
     | 
    
         
            +
                return (0, _workflow.createAsyncWorkflow)();
         
     | 
| 
      
 181 
     | 
    
         
            +
              }
         
     | 
| 
      
 182 
     | 
    
         
            +
             
     | 
| 
      
 183 
     | 
    
         
            +
              if ((0, _workflow.isParallelWorkflow)(hook)) {
         
     | 
| 
      
 184 
     | 
    
         
            +
                return (0, _workflow.createParallelWorkflow)();
         
     | 
| 
      
 185 
     | 
    
         
            +
              }
         
     | 
| 
      
 186 
     | 
    
         
            +
             
     | 
| 
      
 187 
     | 
    
         
            +
              if ((0, _farrowPipeline.isPipeline)(hook)) {
         
     | 
| 
      
 188 
     | 
    
         
            +
                return (0, _farrowPipeline.createPipeline)();
         
     | 
| 
      
 189 
     | 
    
         
            +
              }
         
     | 
| 
      
 190 
     | 
    
         
            +
             
     | 
| 
      
 191 
     | 
    
         
            +
              throw new Error(`Unknown hook: ${hook}`);
         
     | 
| 
      
 192 
     | 
    
         
            +
            };
         
     | 
| 
      
 193 
     | 
    
         
            +
             
     | 
| 
      
 194 
     | 
    
         
            +
            exports.cloneHook = cloneHook;
         
     | 
| 
      
 195 
     | 
    
         
            +
             
     | 
| 
      
 196 
     | 
    
         
            +
            const cloneHooksMap = record => {
         
     | 
| 
      
 197 
     | 
    
         
            +
              if (!record) {
         
     | 
| 
      
 198 
     | 
    
         
            +
                return record;
         
     | 
| 
      
 199 
     | 
    
         
            +
              }
         
     | 
| 
      
 200 
     | 
    
         
            +
             
     | 
| 
      
 201 
     | 
    
         
            +
              const result = {};
         
     | 
| 
      
 202 
     | 
    
         
            +
             
     | 
| 
      
 203 
     | 
    
         
            +
              for (const key in record) {
         
     | 
| 
      
 204 
     | 
    
         
            +
                // eslint-disable-next-line @typescript-eslint/ban-ts-comment
         
     | 
| 
      
 205 
     | 
    
         
            +
                // @ts-expect-error
         
     | 
| 
      
 206 
     | 
    
         
            +
                result[key] = cloneHook(record[key]);
         
     | 
| 
      
 207 
     | 
    
         
            +
              }
         
     | 
| 
      
 208 
     | 
    
         
            +
             
     | 
| 
      
 209 
     | 
    
         
            +
              return result;
         
     | 
| 
      
 210 
     | 
    
         
            +
            };
         
     | 
| 
      
 211 
     | 
    
         
            +
             
     | 
| 
      
 212 
     | 
    
         
            +
            exports.cloneHooksMap = cloneHooksMap;
         
     | 
| 
         
            File without changes
         
     | 
| 
         @@ -0,0 +1,64 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
            exports.isAsyncWaterfall = exports.getAsyncBrook = exports.createAsyncWaterfall = void 0;
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            var _farrowPipeline = require("../farrow-pipeline");
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            const ASYNC_WATERFALL_SYMBOL = Symbol.for('MODERN_ASYNC_WATERFALL');
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            const getAsyncBrook = input => {
         
     | 
| 
      
 19 
     | 
    
         
            +
              if (typeof input === 'function') {
         
     | 
| 
      
 20 
     | 
    
         
            +
                return input;
         
     | 
| 
      
 21 
     | 
    
         
            +
              } else if (input && typeof input.middleware === 'function') {
         
     | 
| 
      
 22 
     | 
    
         
            +
                return input.middleware;
         
     | 
| 
      
 23 
     | 
    
         
            +
              }
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              throw new Error(`${input} is not a AsyncBrook or { brook: AsyncBrook }`);
         
     | 
| 
      
 26 
     | 
    
         
            +
            };
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            exports.getAsyncBrook = getAsyncBrook;
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            const createAsyncWaterfall = () => {
         
     | 
| 
      
 31 
     | 
    
         
            +
              const pipeline = (0, _farrowPipeline.createAsyncPipeline)();
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              const use = (...input) => {
         
     | 
| 
      
 34 
     | 
    
         
            +
                pipeline.use(...input.map(getAsyncBrook).map(mapAsyncBrookToAsyncMiddleware));
         
     | 
| 
      
 35 
     | 
    
         
            +
                return waterfall;
         
     | 
| 
      
 36 
     | 
    
         
            +
              };
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              const run = (input, options) => pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
         
     | 
| 
      
 39 
     | 
    
         
            +
                onLast: input => input
         
     | 
| 
      
 40 
     | 
    
         
            +
              }));
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              const middleware = input => {
         
     | 
| 
      
 43 
     | 
    
         
            +
                return pipeline.run(input, {
         
     | 
| 
      
 44 
     | 
    
         
            +
                  onLast: input => input
         
     | 
| 
      
 45 
     | 
    
         
            +
                });
         
     | 
| 
      
 46 
     | 
    
         
            +
              };
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              const waterfall = _objectSpread(_objectSpread({}, pipeline), {}, {
         
     | 
| 
      
 49 
     | 
    
         
            +
                use,
         
     | 
| 
      
 50 
     | 
    
         
            +
                run,
         
     | 
| 
      
 51 
     | 
    
         
            +
                middleware,
         
     | 
| 
      
 52 
     | 
    
         
            +
                [ASYNC_WATERFALL_SYMBOL]: true
         
     | 
| 
      
 53 
     | 
    
         
            +
              });
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
              return waterfall;
         
     | 
| 
      
 56 
     | 
    
         
            +
            };
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
            exports.createAsyncWaterfall = createAsyncWaterfall;
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            const isAsyncWaterfall = input => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WATERFALL_SYMBOL]);
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
            exports.isAsyncWaterfall = isAsyncWaterfall;
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
            const mapAsyncBrookToAsyncMiddleware = brook => async (input, next) => next(await brook(input));
         
     | 
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            var _sync = require("./sync");
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            Object.keys(_sync).forEach(function (key) {
         
     | 
| 
      
 10 
     | 
    
         
            +
              if (key === "default" || key === "__esModule") return;
         
     | 
| 
      
 11 
     | 
    
         
            +
              if (key in exports && exports[key] === _sync[key]) return;
         
     | 
| 
      
 12 
     | 
    
         
            +
              Object.defineProperty(exports, key, {
         
     | 
| 
      
 13 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 14 
     | 
    
         
            +
                get: function () {
         
     | 
| 
      
 15 
     | 
    
         
            +
                  return _sync[key];
         
     | 
| 
      
 16 
     | 
    
         
            +
                }
         
     | 
| 
      
 17 
     | 
    
         
            +
              });
         
     | 
| 
      
 18 
     | 
    
         
            +
            });
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            var _async = require("./async");
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            Object.keys(_async).forEach(function (key) {
         
     | 
| 
      
 23 
     | 
    
         
            +
              if (key === "default" || key === "__esModule") return;
         
     | 
| 
      
 24 
     | 
    
         
            +
              if (key in exports && exports[key] === _async[key]) return;
         
     | 
| 
      
 25 
     | 
    
         
            +
              Object.defineProperty(exports, key, {
         
     | 
| 
      
 26 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 27 
     | 
    
         
            +
                get: function () {
         
     | 
| 
      
 28 
     | 
    
         
            +
                  return _async[key];
         
     | 
| 
      
 29 
     | 
    
         
            +
                }
         
     | 
| 
      
 30 
     | 
    
         
            +
              });
         
     | 
| 
      
 31 
     | 
    
         
            +
            });
         
     | 
| 
         @@ -0,0 +1,64 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
            exports.isWaterfall = exports.getBrook = exports.createWaterfall = void 0;
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            var _farrowPipeline = require("../farrow-pipeline");
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            const WATERFALL_SYMBOL = Symbol.for('MODERN_WATERFALL');
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            const getBrook = input => {
         
     | 
| 
      
 19 
     | 
    
         
            +
              if (typeof input === 'function') {
         
     | 
| 
      
 20 
     | 
    
         
            +
                return input;
         
     | 
| 
      
 21 
     | 
    
         
            +
              } else if (input && typeof input.middleware === 'function') {
         
     | 
| 
      
 22 
     | 
    
         
            +
                return input.middleware;
         
     | 
| 
      
 23 
     | 
    
         
            +
              }
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              throw new Error(`${input} is not a Brook or { brook: Brook }`);
         
     | 
| 
      
 26 
     | 
    
         
            +
            };
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            exports.getBrook = getBrook;
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            const createWaterfall = () => {
         
     | 
| 
      
 31 
     | 
    
         
            +
              const pipeline = (0, _farrowPipeline.createPipeline)();
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              const use = (...brooks) => {
         
     | 
| 
      
 34 
     | 
    
         
            +
                pipeline.use(...brooks.map(getBrook).map(mapBrookToMiddleware));
         
     | 
| 
      
 35 
     | 
    
         
            +
                return waterfall;
         
     | 
| 
      
 36 
     | 
    
         
            +
              };
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              const run = (input, options) => pipeline.run(input, _objectSpread(_objectSpread({}, options), {}, {
         
     | 
| 
      
 39 
     | 
    
         
            +
                onLast: input => input
         
     | 
| 
      
 40 
     | 
    
         
            +
              }));
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              const middleware = input => {
         
     | 
| 
      
 43 
     | 
    
         
            +
                return pipeline.run(input, {
         
     | 
| 
      
 44 
     | 
    
         
            +
                  onLast: input => input
         
     | 
| 
      
 45 
     | 
    
         
            +
                });
         
     | 
| 
      
 46 
     | 
    
         
            +
              };
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              const waterfall = _objectSpread(_objectSpread({}, pipeline), {}, {
         
     | 
| 
      
 49 
     | 
    
         
            +
                use,
         
     | 
| 
      
 50 
     | 
    
         
            +
                run,
         
     | 
| 
      
 51 
     | 
    
         
            +
                middleware,
         
     | 
| 
      
 52 
     | 
    
         
            +
                [WATERFALL_SYMBOL]: true
         
     | 
| 
      
 53 
     | 
    
         
            +
              });
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
              return waterfall;
         
     | 
| 
      
 56 
     | 
    
         
            +
            };
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
            exports.createWaterfall = createWaterfall;
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            const isWaterfall = input => Boolean(input === null || input === void 0 ? void 0 : input[WATERFALL_SYMBOL]);
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
            exports.isWaterfall = isWaterfall;
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
            const mapBrookToMiddleware = brook => (input, next) => next(brook(input));
         
     | 
| 
         @@ -0,0 +1,57 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
            exports.isAsyncWorkflow = exports.createAsyncWorkflow = void 0;
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            var _farrowPipeline = require("../farrow-pipeline");
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            const ASYNC_WORKFLOW_SYMBOL = Symbol.for('MODERN_ASYNC_WORKFLOW');
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            const isAsyncWorkflow = input => Boolean(input === null || input === void 0 ? void 0 : input[ASYNC_WORKFLOW_SYMBOL]);
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            exports.isAsyncWorkflow = isAsyncWorkflow;
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            const createAsyncWorkflow = () => {
         
     | 
| 
      
 23 
     | 
    
         
            +
              const pipeline = (0, _farrowPipeline.createAsyncPipeline)();
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              const use = (...input) => {
         
     | 
| 
      
 26 
     | 
    
         
            +
                pipeline.use(...input.map(mapAsyncWorkerToAsyncMiddleware));
         
     | 
| 
      
 27 
     | 
    
         
            +
                return workflow;
         
     | 
| 
      
 28 
     | 
    
         
            +
              };
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              const run = async input => {
         
     | 
| 
      
 31 
     | 
    
         
            +
                const result = pipeline.run(input, {
         
     | 
| 
      
 32 
     | 
    
         
            +
                  onLast: () => []
         
     | 
| 
      
 33 
     | 
    
         
            +
                });
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                if (isPromise(result)) {
         
     | 
| 
      
 36 
     | 
    
         
            +
                  return result.then(result => result.filter(Boolean));
         
     | 
| 
      
 37 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 38 
     | 
    
         
            +
                  return result.filter(Boolean);
         
     | 
| 
      
 39 
     | 
    
         
            +
                }
         
     | 
| 
      
 40 
     | 
    
         
            +
              };
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              const workflow = _objectSpread(_objectSpread({}, pipeline), {}, {
         
     | 
| 
      
 43 
     | 
    
         
            +
                use,
         
     | 
| 
      
 44 
     | 
    
         
            +
                run,
         
     | 
| 
      
 45 
     | 
    
         
            +
                [ASYNC_WORKFLOW_SYMBOL]: true
         
     | 
| 
      
 46 
     | 
    
         
            +
              });
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              return workflow;
         
     | 
| 
      
 49 
     | 
    
         
            +
            };
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
            exports.createAsyncWorkflow = createAsyncWorkflow;
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
            const mapAsyncWorkerToAsyncMiddleware = worker => async (input, next) => [await worker(input), ...(await next(input))];
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
            function isPromise(obj) {
         
     | 
| 
      
 56 
     | 
    
         
            +
              return Boolean(obj) && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
         
     | 
| 
      
 57 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -0,0 +1,44 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            var _sync = require("./sync");
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            Object.keys(_sync).forEach(function (key) {
         
     | 
| 
      
 10 
     | 
    
         
            +
              if (key === "default" || key === "__esModule") return;
         
     | 
| 
      
 11 
     | 
    
         
            +
              if (key in exports && exports[key] === _sync[key]) return;
         
     | 
| 
      
 12 
     | 
    
         
            +
              Object.defineProperty(exports, key, {
         
     | 
| 
      
 13 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 14 
     | 
    
         
            +
                get: function () {
         
     | 
| 
      
 15 
     | 
    
         
            +
                  return _sync[key];
         
     | 
| 
      
 16 
     | 
    
         
            +
                }
         
     | 
| 
      
 17 
     | 
    
         
            +
              });
         
     | 
| 
      
 18 
     | 
    
         
            +
            });
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            var _parallel = require("./parallel");
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            Object.keys(_parallel).forEach(function (key) {
         
     | 
| 
      
 23 
     | 
    
         
            +
              if (key === "default" || key === "__esModule") return;
         
     | 
| 
      
 24 
     | 
    
         
            +
              if (key in exports && exports[key] === _parallel[key]) return;
         
     | 
| 
      
 25 
     | 
    
         
            +
              Object.defineProperty(exports, key, {
         
     | 
| 
      
 26 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 27 
     | 
    
         
            +
                get: function () {
         
     | 
| 
      
 28 
     | 
    
         
            +
                  return _parallel[key];
         
     | 
| 
      
 29 
     | 
    
         
            +
                }
         
     | 
| 
      
 30 
     | 
    
         
            +
              });
         
     | 
| 
      
 31 
     | 
    
         
            +
            });
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            var _async = require("./async");
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            Object.keys(_async).forEach(function (key) {
         
     | 
| 
      
 36 
     | 
    
         
            +
              if (key === "default" || key === "__esModule") return;
         
     | 
| 
      
 37 
     | 
    
         
            +
              if (key in exports && exports[key] === _async[key]) return;
         
     | 
| 
      
 38 
     | 
    
         
            +
              Object.defineProperty(exports, key, {
         
     | 
| 
      
 39 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 40 
     | 
    
         
            +
                get: function () {
         
     | 
| 
      
 41 
     | 
    
         
            +
                  return _async[key];
         
     | 
| 
      
 42 
     | 
    
         
            +
                }
         
     | 
| 
      
 43 
     | 
    
         
            +
              });
         
     | 
| 
      
 44 
     | 
    
         
            +
            });
         
     | 
| 
         @@ -0,0 +1,45 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
            exports.isParallelWorkflow = exports.createParallelWorkflow = void 0;
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            var _farrowPipeline = require("../farrow-pipeline");
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            const PARALLEL_WORKFLOW_SYMBOL = Symbol.for('MODERN_PARALLEL_WORKFLOW');
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            const isParallelWorkflow = input => Boolean(input === null || input === void 0 ? void 0 : input[PARALLEL_WORKFLOW_SYMBOL]);
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            exports.isParallelWorkflow = isParallelWorkflow;
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            const createParallelWorkflow = () => {
         
     | 
| 
      
 23 
     | 
    
         
            +
              const pipeline = (0, _farrowPipeline.createPipeline)();
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              const use = (...input) => {
         
     | 
| 
      
 26 
     | 
    
         
            +
                pipeline.use(...input.map(mapParallelWorkerToAsyncMiddleware));
         
     | 
| 
      
 27 
     | 
    
         
            +
                return workflow;
         
     | 
| 
      
 28 
     | 
    
         
            +
              };
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              const run = async input => Promise.all(pipeline.run(input, {
         
     | 
| 
      
 31 
     | 
    
         
            +
                onLast: () => []
         
     | 
| 
      
 32 
     | 
    
         
            +
              })).then(result => result.filter(Boolean));
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              const workflow = _objectSpread(_objectSpread({}, pipeline), {}, {
         
     | 
| 
      
 35 
     | 
    
         
            +
                run,
         
     | 
| 
      
 36 
     | 
    
         
            +
                use,
         
     | 
| 
      
 37 
     | 
    
         
            +
                [PARALLEL_WORKFLOW_SYMBOL]: true
         
     | 
| 
      
 38 
     | 
    
         
            +
              });
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              return workflow;
         
     | 
| 
      
 41 
     | 
    
         
            +
            };
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            exports.createParallelWorkflow = createParallelWorkflow;
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            const mapParallelWorkerToAsyncMiddleware = worker => (input, next) => [worker(input), ...next(input)];
         
     | 
| 
         @@ -0,0 +1,48 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            "use strict";
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
      
 4 
     | 
    
         
            +
              value: true
         
     | 
| 
      
 5 
     | 
    
         
            +
            });
         
     | 
| 
      
 6 
     | 
    
         
            +
            exports.isWorkflow = exports.createWorkflow = void 0;
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            var _farrowPipeline = require("../farrow-pipeline");
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            const WORKFLOW_SYMBOL = Symbol.for('MODERN_WORKFLOW');
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            const createWorkflow = () => {
         
     | 
| 
      
 19 
     | 
    
         
            +
              const pipeline = (0, _farrowPipeline.createPipeline)();
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              const use = (...input) => {
         
     | 
| 
      
 22 
     | 
    
         
            +
                pipeline.use(...input.map(mapWorkerToMiddleware));
         
     | 
| 
      
 23 
     | 
    
         
            +
                return workflow;
         
     | 
| 
      
 24 
     | 
    
         
            +
              };
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
              const run = input => {
         
     | 
| 
      
 27 
     | 
    
         
            +
                const result = pipeline.run(input, {
         
     | 
| 
      
 28 
     | 
    
         
            +
                  onLast: () => []
         
     | 
| 
      
 29 
     | 
    
         
            +
                });
         
     | 
| 
      
 30 
     | 
    
         
            +
                return result.filter(Boolean);
         
     | 
| 
      
 31 
     | 
    
         
            +
              };
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              const workflow = _objectSpread(_objectSpread({}, pipeline), {}, {
         
     | 
| 
      
 34 
     | 
    
         
            +
                use,
         
     | 
| 
      
 35 
     | 
    
         
            +
                run,
         
     | 
| 
      
 36 
     | 
    
         
            +
                [WORKFLOW_SYMBOL]: true
         
     | 
| 
      
 37 
     | 
    
         
            +
              });
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
              return workflow;
         
     | 
| 
      
 40 
     | 
    
         
            +
            };
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
            exports.createWorkflow = createWorkflow;
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            const isWorkflow = input => Boolean(input === null || input === void 0 ? void 0 : input[WORKFLOW_SYMBOL]);
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            exports.isWorkflow = isWorkflow;
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
            const mapWorkerToMiddleware = worker => (input, next) => [worker(input), ...next(input)];
         
     | 
| 
         @@ -0,0 +1,42 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            /**
         
     | 
| 
      
 2 
     | 
    
         
            +
             * modified from https://github.com/farrow-js/farrow/tree/master/packages/farrow-pipeline
         
     | 
| 
      
 3 
     | 
    
         
            +
             * license at https://github.com/farrow-js/farrow/blob/master/LICENSE
         
     | 
| 
      
 4 
     | 
    
         
            +
             */
         
     | 
| 
      
 5 
     | 
    
         
            +
            export var createContext = function createContext(value) {
         
     | 
| 
      
 6 
     | 
    
         
            +
              var currentValue;
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              var create = function create(value) {
         
     | 
| 
      
 9 
     | 
    
         
            +
                currentValue = value;
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                var use = function use() {
         
     | 
| 
      
 12 
     | 
    
         
            +
                  return {
         
     | 
| 
      
 13 
     | 
    
         
            +
                    get value() {
         
     | 
| 
      
 14 
     | 
    
         
            +
                      return currentValue;
         
     | 
| 
      
 15 
     | 
    
         
            +
                    },
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                    set value(v) {
         
     | 
| 
      
 18 
     | 
    
         
            +
                      currentValue = v;
         
     | 
| 
      
 19 
     | 
    
         
            +
                    }
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                  };
         
     | 
| 
      
 22 
     | 
    
         
            +
                };
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                var get = function get() {
         
     | 
| 
      
 25 
     | 
    
         
            +
                  return currentValue;
         
     | 
| 
      
 26 
     | 
    
         
            +
                };
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                var set = function set(v) {
         
     | 
| 
      
 29 
     | 
    
         
            +
                  currentValue = v;
         
     | 
| 
      
 30 
     | 
    
         
            +
                };
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                var Context = {
         
     | 
| 
      
 33 
     | 
    
         
            +
                  create: create,
         
     | 
| 
      
 34 
     | 
    
         
            +
                  use: use,
         
     | 
| 
      
 35 
     | 
    
         
            +
                  get: get,
         
     | 
| 
      
 36 
     | 
    
         
            +
                  set: set
         
     | 
| 
      
 37 
     | 
    
         
            +
                };
         
     | 
| 
      
 38 
     | 
    
         
            +
                return Context;
         
     | 
| 
      
 39 
     | 
    
         
            +
              };
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
              return create(value);
         
     | 
| 
      
 42 
     | 
    
         
            +
            };
         
     | 
| 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            /**
         
     | 
| 
      
 2 
     | 
    
         
            +
             * modified from https://github.com/farrow-js/farrow/tree/master/packages/farrow-pipeline
         
     | 
| 
      
 3 
     | 
    
         
            +
             * license at https://github.com/farrow-js/farrow/blob/master/LICENSE
         
     | 
| 
      
 4 
     | 
    
         
            +
             */
         
     | 
| 
      
 5 
     | 
    
         
            +
            export var createCounter = function createCounter(callback) {
         
     | 
| 
      
 6 
     | 
    
         
            +
              var dispatch = function dispatch(index, input) {
         
     | 
| 
      
 7 
     | 
    
         
            +
                var next = function next() {
         
     | 
| 
      
 8 
     | 
    
         
            +
                  var nextInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : input;
         
     | 
| 
      
 9 
     | 
    
         
            +
                  return dispatch(index + 1, nextInput);
         
     | 
| 
      
 10 
     | 
    
         
            +
                };
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                return callback(index, input, next);
         
     | 
| 
      
 13 
     | 
    
         
            +
              };
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              var start = function start(input) {
         
     | 
| 
      
 16 
     | 
    
         
            +
                return dispatch(0, input);
         
     | 
| 
      
 17 
     | 
    
         
            +
              };
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              return {
         
     | 
| 
      
 20 
     | 
    
         
            +
                start: start,
         
     | 
| 
      
 21 
     | 
    
         
            +
                dispatch: dispatch
         
     | 
| 
      
 22 
     | 
    
         
            +
              };
         
     | 
| 
      
 23 
     | 
    
         
            +
            };
         
     |