github-sync-labels-milestones
Version:
Sync Labels and Milestones across Multiple repositories
23 lines (17 loc) • 385 B
JavaScript
;
var _ = require('lodash');
module.exports = function getExisting(existing, posibleValues, by) {
var found = [];
posibleValues.forEach(function (value) {
if (!value) {
return;
}
var query = {};
query[by] = value;
found.push(_.find(existing, query));
});
found = found.filter(function (ms) {
return !!ms;
});
return found;
};