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.

index.js 615B

1234567891011121314151617181920212223242526272829
  1. 'use strict'
  2. module.exports = toString
  3. // Get the text content of a node.
  4. // Prefer the node’s plain-text fields, otherwise serialize its children,
  5. // and if the given value is an array, serialize the nodes in it.
  6. function toString(node) {
  7. return (
  8. (node &&
  9. (node.value ||
  10. node.alt ||
  11. node.title ||
  12. ('children' in node && all(node.children)) ||
  13. ('length' in node && all(node)))) ||
  14. ''
  15. )
  16. }
  17. function all(values) {
  18. var result = []
  19. var index = -1
  20. while (++index < values.length) {
  21. result[index] = toString(values[index])
  22. }
  23. return result.join('')
  24. }