liftie
Version:
Clean, simple, easy to read, fast ski resort lift status
27 lines (25 loc) • 486 B
JavaScript
import toTitleCase from 'to-title-case';
export default {
selector: '[class*="impianto-status"]',
parse: {
name: {
child: '../0/1',
fn: toTitleCase
},
status: {
child: '.',
attribute: 'class',
regex: /impianto-status-([FPO])/,
fn: s => {
switch (s) {
case 'F':
return 'closed';
case 'P':
return 'hold';
case 'O':
return 'open';
}
}
}
}
};