Icard/angular-clarity-master(work.../node_modules/@angular-devkit/architect/builders/concat.js

45 lines
7.0 KiB
JavaScript

"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = require("rxjs");
const src_1 = require("../src");
exports.default = (0, src_1.createBuilder)((options, context) => {
const allRuns = [];
context.reportProgress(0, (options.targets ? options.targets.length : 0) +
(options.builders ? options.builders.length : 0));
if (options.targets) {
allRuns.push(...options.targets.map(({ target: targetStr, overrides }) => {
const [project, target, configuration] = targetStr.split(/:/g, 3);
return () => context.scheduleTarget({ project, target, configuration }, overrides || {});
}));
}
if (options.builders) {
allRuns.push(...options.builders.map(({ builder, options }) => {
return () => context.scheduleBuilder(builder, options || {});
}));
}
let stop = null;
let i = 0;
context.reportProgress(i++, allRuns.length);
return (0, rxjs_1.from)(allRuns).pipe((0, rxjs_1.concatMap)((fn) => stop
? (0, rxjs_1.of)(null)
: (0, rxjs_1.from)(fn()).pipe((0, rxjs_1.switchMap)((run) => (run === null ? (0, rxjs_1.of)(null) : run.output.pipe((0, rxjs_1.first)()))))), (0, rxjs_1.map)((output) => {
context.reportProgress(i++, allRuns.length);
if (output === null || stop !== null) {
return stop || { success: false };
}
else if (output.success === false) {
return (stop = output);
}
else {
return output;
}
}), (0, rxjs_1.last)());
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uY2F0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhcl9kZXZraXQvYXJjaGl0ZWN0L2J1aWxkZXJzL2NvbmNhdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7OztHQU1HOztBQUdILCtCQUF3RTtBQUN4RSxnQ0FBa0U7QUFHbEUsa0JBQW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