debian-mirror-gitlab/app/assets/javascripts/pipeline_new/utils/format_refs.js
2021-03-08 18:12:59 +05:30

19 lines
367 B
JavaScript

import { BRANCH_REF_TYPE, TAG_REF_TYPE } from '../constants';
export default (refs, type) => {
let fullName;
return refs.map((ref) => {
if (type === BRANCH_REF_TYPE) {
fullName = `refs/heads/${ref}`;
} else if (type === TAG_REF_TYPE) {
fullName = `refs/tags/${ref}`;
}
return {
shortName: ref,
fullName,
};
});
};