Add getStatusName helper

This commit is contained in:
Sam Carlton 2021-03-04 20:45:49 -06:00
parent 874e8738bd
commit b725880da3

View file

@ -1,7 +1,20 @@
export default {
const statuses = {
'✅': 'native', '✅': 'native',
'✳️': 'rosetta', '✳️': 'rosetta',
'⏹': 'no-in-progress', '⏹': 'no-in-progress',
'🚫': 'no', '🚫': 'no',
'🔶': 'unreported', '🔶': 'unreported',
} }
export function getStatusName ( status ) {
for (const key in statuses) {
if (status.trim().startsWith( key )) return statuses[key]
}
throw new Error('Non status matched')
}
export default statuses