UNPKG

@atomist/automation-client

Version:

Atomist API for software low-level client

30 lines 864 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _ = require("lodash"); class DefaultTaggerTags { constructor(repoId, tags) { this.repoId = repoId; this.tags = tags; } } exports.DefaultTaggerTags = DefaultTaggerTags; /** * Combine these taggers * @param t0 first tagger * @param {Tagger} taggers * @return {Tagger} */ function unifiedTagger(t0, ...taggers) { return (p, context, params) => { const allTags = Promise.all(([t0].concat(taggers)).map(t => t(p, context, params))); return allTags.then(tags => { return unify(tags); }); }; } exports.unifiedTagger = unifiedTagger; function unify(tags) { const uniqueTags = _.uniq(_.flatMap(tags, t => t.tags)); return new DefaultTaggerTags(tags[0].repoId, uniqueTags); } //# sourceMappingURL=Tagger.js.map