UNPKG

@ng-doc/builder

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>

29 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveAsyncFileOutputs = resolveAsyncFileOutputs; const rxjs_1 = require("rxjs"); const operators_1 = require("rxjs/operators"); const types_1 = require("../types"); /** * */ function resolveAsyncFileOutputs() { return (source) => source.pipe((0, rxjs_1.concatMap)((states) => { const result = states.map((state) => { if ((0, types_1.isBuilderError)(state)) { return (0, rxjs_1.of)(state); } else { if ((0, types_1.isFileOutput)(state.result)) { return (0, rxjs_1.of)(state); } return (0, rxjs_1.from)(state.result()).pipe((0, operators_1.map)((output) => new types_1.BuilderDone(state.tag, output)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)(new types_1.BuilderError(state.tag, error)))); } }); if (!result.length) { return rxjs_1.EMPTY; } return (0, rxjs_1.forkJoin)(result).pipe((0, rxjs_1.concatAll)()); })); } //# sourceMappingURL=resolve-async-file-outputs.js.map