Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

variants.js 809B

1234567891011121314151617181920212223242526272829303132333435
  1. 'use strict'
  2. const names = {
  3. '': 'adult'
  4. , E: 'reduced'
  5. , T: '1 day, adult'
  6. , F: 'bike'
  7. , M: '4x adult'
  8. , ME: '4x reduced'
  9. , TE: '1 day, reduced'
  10. , TF: '1 day, bike'
  11. , TK: '1 day, group'
  12. , SG: '1 day, group reduced'
  13. }
  14. const props = {
  15. '': {amount: 1}
  16. , E: {amount: 1, reduced: true}
  17. , T: {amount: 1, fullDay: true}
  18. , F: {amount: 1, bike: true}
  19. , M: {amount: 4}
  20. , ME: {amount: 4, reduced: true}
  21. , TE: {amount: 1, reduced: true, fullDay: true}
  22. , TF: {amount: 1, bike: true, fullDay: true}
  23. , TK: {amount: 1, group: true, fullDay: true}
  24. , SG: {amount: 1, reduced: true, group: true, fullDay: true}
  25. }
  26. const parse = (ticket, code) => {
  27. if (code in names) ticket.variant = names[code]
  28. if (code in props) Object.assign(ticket, props[code])
  29. return ticket
  30. }
  31. module.exports = parse