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

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const minimatch = require('minimatch');
  3. const arrayUnion = require('array-union');
  4. const arrayDiffer = require('array-differ');
  5. const arrify = require('arrify');
  6. module.exports = (list, patterns, options = {}) => {
  7. list = arrify(list);
  8. patterns = arrify(patterns);
  9. if (list.length === 0 || patterns.length === 0) {
  10. return [];
  11. }
  12. return patterns.reduce((result, pattern) => {
  13. let process = arrayUnion;
  14. if (pattern[0] === '!') {
  15. pattern = pattern.slice(1);
  16. process = arrayDiffer;
  17. }
  18. return process(result, minimatch.match(list, pattern, options));
  19. }, []);
  20. };