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.

container-flow.js 928B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module.exports = flow
  2. var repeat = require('repeat-string')
  3. function flow(parent, context) {
  4. var children = parent.children || []
  5. var results = []
  6. var index = -1
  7. var child
  8. while (++index < children.length) {
  9. child = children[index]
  10. results.push(
  11. context.handle(child, parent, context, {before: '\n', after: '\n'})
  12. )
  13. if (index + 1 < children.length) {
  14. results.push(between(child, children[index + 1]))
  15. }
  16. }
  17. return results.join('')
  18. function between(left, right) {
  19. var index = -1
  20. var result
  21. while (++index < context.join.length) {
  22. result = context.join[index](left, right, parent, context)
  23. if (result === true || result === 1) {
  24. break
  25. }
  26. if (typeof result === 'number') {
  27. return repeat('\n', 1 + Number(result))
  28. }
  29. if (result === false) {
  30. return '\n\n<!---->\n\n'
  31. }
  32. }
  33. return '\n\n'
  34. }
  35. }