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.

pattern-in-scope.js 481B

123456789101112131415161718192021222324252627282930
  1. module.exports = patternInScope
  2. function patternInScope(stack, pattern) {
  3. return (
  4. listInScope(stack, pattern.inConstruct, true) &&
  5. !listInScope(stack, pattern.notInConstruct)
  6. )
  7. }
  8. function listInScope(stack, list, none) {
  9. var index
  10. if (!list) {
  11. return none
  12. }
  13. if (typeof list === 'string') {
  14. list = [list]
  15. }
  16. index = -1
  17. while (++index < list.length) {
  18. if (stack.indexOf(list[index]) !== -1) {
  19. return true
  20. }
  21. }
  22. return false
  23. }