1 | 'use strict';
|
2 | var aSet = require('../internals/a-set');
|
3 | var has = require('../internals/set-helpers').has;
|
4 | var size = require('../internals/set-size');
|
5 | var getSetRecord = require('../internals/get-set-record');
|
6 | var iterateSimple = require('../internals/iterate-simple');
|
7 | var iteratorClose = require('../internals/iterator-close');
|
8 |
|
9 |
|
10 |
|
11 | module.exports = function isSupersetOf(other) {
|
12 | var O = aSet(this);
|
13 | var otherRec = getSetRecord(other);
|
14 | if (size(O) < otherRec.size) return false;
|
15 | var iterator = otherRec.getIterator();
|
16 | return iterateSimple(iterator, function (e) {
|
17 | if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
|
18 | }) !== false;
|
19 | };
|