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.

esnext.set.filter.js 1.1KB

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var IS_PURE = require('../internals/is-pure');
  4. var getBuiltIn = require('../internals/get-built-in');
  5. var anObject = require('../internals/an-object');
  6. var aFunction = require('../internals/a-function');
  7. var bind = require('../internals/function-bind-context');
  8. var speciesConstructor = require('../internals/species-constructor');
  9. var getSetIterator = require('../internals/get-set-iterator');
  10. var iterate = require('../internals/iterate');
  11. // `Set.prototype.filter` method
  12. // https://github.com/tc39/proposal-collection-methods
  13. $({ target: 'Set', proto: true, real: true, forced: IS_PURE }, {
  14. filter: function filter(callbackfn /* , thisArg */) {
  15. var set = anObject(this);
  16. var iterator = getSetIterator(set);
  17. var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  18. var newSet = new (speciesConstructor(set, getBuiltIn('Set')))();
  19. var adder = aFunction(newSet.add);
  20. iterate(iterator, function (value) {
  21. if (boundFunction(value, value, set)) adder.call(newSet, value);
  22. }, { IS_ITERATOR: true });
  23. return newSet;
  24. }
  25. });