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.

walk.js 425B

12345678910111213141516171819202122
  1. module.exports = function walk(nodes, cb, bubble) {
  2. var i, max, node, result;
  3. for (i = 0, max = nodes.length; i < max; i += 1) {
  4. node = nodes[i];
  5. if (!bubble) {
  6. result = cb(node, i, nodes);
  7. }
  8. if (
  9. result !== false &&
  10. node.type === "function" &&
  11. Array.isArray(node.nodes)
  12. ) {
  13. walk(node.nodes, cb, bubble);
  14. }
  15. if (bubble) {
  16. cb(node, i, nodes);
  17. }
  18. }
  19. };