Created
January 10, 2018 20:49
-
-
Save triblondon/06264253749bef68bc9a8278780c648c to your computer and use it in GitHub Desktop.
reformat sigs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list.split('\n') | |
.map(line => { | |
const parts = line.match(/<a href=['"](.*?)['"]>(.*?)\s+(\S+)\s*<\/a>/); | |
if (parts) { | |
return {givenName: parts[2], familyName: parts[3], url: parts[1]}; | |
} else { | |
console.log(line); | |
} | |
}) | |
.sort((a,b) => a['familyName'] > b['familyName'] ? 1 : -1) | |
.filter(x => !!x) | |
.map(obj => `<li><a href="${obj.url}">${obj.givenName} ${obj.familyName}</a></li>`) | |
.join('\n') | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment