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.

create-set.js 939B

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. var typeOf = require("@sinonjs/commons").typeOf;
  3. var forEach = require("@sinonjs/commons").prototypes.array.forEach;
  4. /**
  5. * This helper makes it convenient to create Set instances from a
  6. * collection, an overcomes the shortcoming that IE11 doesn't support
  7. * collection arguments
  8. *
  9. * @private
  10. * @param {Array} array An array to create a set from
  11. * @returns {Set} A set (unique) containing the members from array
  12. *
  13. * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
  14. */
  15. function createSet(array) {
  16. if (arguments.length > 0 && !Array.isArray(array)) {
  17. throw new TypeError(
  18. "createSet can be called with either no arguments or an Array"
  19. );
  20. }
  21. var items = typeOf(array) === "array" ? array : [];
  22. var set = new Set();
  23. forEach(items, function (item) {
  24. set.add(item);
  25. });
  26. return set;
  27. }
  28. module.exports = createSet;