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 747B

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict'
  2. var convert = require('unist-util-is/convert')
  3. module.exports = findAllAfter
  4. function findAllAfter(parent, index, test) {
  5. var is = convert(test)
  6. var results = []
  7. if (!parent || !parent.type || !parent.children) {
  8. throw new Error('Expected parent node')
  9. }
  10. if (typeof index === 'number') {
  11. if (index < 0 || index === Infinity) {
  12. throw new Error('Expected positive finite number as index')
  13. }
  14. } else {
  15. index = parent.children.indexOf(index)
  16. if (index < 0) {
  17. throw new Error('Expected child node or index')
  18. }
  19. }
  20. while (++index < parent.children.length) {
  21. if (is(parent.children[index], index, parent)) {
  22. results.push(parent.children[index])
  23. }
  24. }
  25. return results
  26. }