You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Takes a list of file paths, and converts it into clickable linksconstlinkableFiles=(paths: Array<string>): string=>{constrepoURL=danger.github.pr.head.repo.html_url;constref=danger.github.pr.head.ref;constlinks=paths.map(path=>{returncreateLink(`${repoURL}/blob/${ref}/${path}`,path);});returntoSentence(links);};
I think we probably also need util functions that are specific to universal Danger use-cases, mainly as the JS core lib is relatively weak:
danger.utils.sentence:
// ["1", "2", "3"] to "1, 2 and 3"consttoSentence=(array: Array<string>) : string=>{if(array.length===1){returnarray[0];}returnarray.slice(0,array.length-1).join(', ')+' and '+array.pop();};
danger.utils.href:
// ("/href/thing", "name") to "<a href="/href/thing">name</a>"constcreateLink=(href: string,text: string): string=>`<a href='${href}'>${text}</a>`;
The text was updated successfully, but these errors were encountered:
From jestjs/jest#2508
danger.github.linkFiles
->I think we probably also need util functions that are specific to universal Danger use-cases, mainly as the JS core lib is relatively weak:
danger.utils.sentence
:danger.utils.href
:The text was updated successfully, but these errors were encountered: