Node-Red configuration
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.

set-is-subset-of.js 578B

12345678910111213141516
  1. 'use strict';
  2. var aSet = require('../internals/a-set');
  3. var size = require('../internals/set-size');
  4. var iterate = require('../internals/set-iterate');
  5. var getSetRecord = require('../internals/get-set-record');
  6. // `Set.prototype.isSubsetOf` method
  7. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
  8. module.exports = function isSubsetOf(other) {
  9. var O = aSet(this);
  10. var otherRec = getSetRecord(other);
  11. if (size(O) > otherRec.size) return false;
  12. return iterate(O, function (e) {
  13. if (!otherRec.includes(e)) return false;
  14. }, true) !== false;
  15. };