reportArtifactLinks.js 542 B

12345678910111213141516
  1. function reportArtifactUrl(item = {}, kind) {
  2. if (kind === 'background') return item.backgroundReportUrl || ''
  3. if (kind === 'professional') return item.professionalReportUrl || ''
  4. if (kind === 'public') return item.publicReportUrl || item.fileUrl || ''
  5. return ''
  6. }
  7. function reportArtifactLinks(item = {}) {
  8. return {
  9. background: reportArtifactUrl(item, 'background'),
  10. professional: reportArtifactUrl(item, 'professional'),
  11. public: reportArtifactUrl(item, 'public')
  12. }
  13. }
  14. module.exports = { reportArtifactUrl, reportArtifactLinks }