source: imaps-frontend/node_modules/core-js/internals/set-is-disjoint-from.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 924 bytes
Line 
1'use strict';
2var aSet = require('../internals/a-set');
3var has = require('../internals/set-helpers').has;
4var size = require('../internals/set-size');
5var getSetRecord = require('../internals/get-set-record');
6var iterateSet = require('../internals/set-iterate');
7var iterateSimple = require('../internals/iterate-simple');
8var iteratorClose = require('../internals/iterator-close');
9
10// `Set.prototype.isDisjointFrom` method
11// https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
12module.exports = function isDisjointFrom(other) {
13 var O = aSet(this);
14 var otherRec = getSetRecord(other);
15 if (size(O) <= otherRec.size) return iterateSet(O, function (e) {
16 if (otherRec.includes(e)) return false;
17 }, true) !== false;
18 var iterator = otherRec.getIterator();
19 return iterateSimple(iterator, function (e) {
20 if (has(O, e)) return iteratorClose(iterator, 'normal', false);
21 }) !== false;
22};
Note: See TracBrowser for help on using the repository browser.