main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 6 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
578 bytes
|
Rev | Line | |
---|
[79a0317] | 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 |
|
---|
| 7 | // `Set.prototype.isSubsetOf` method
|
---|
| 8 | // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
|
---|
| 9 | module.exports = function isSubsetOf(other) {
|
---|
| 10 | var O = aSet(this);
|
---|
| 11 | var otherRec = getSetRecord(other);
|
---|
| 12 | if (size(O) > otherRec.size) return false;
|
---|
| 13 | return iterate(O, function (e) {
|
---|
| 14 | if (!otherRec.includes(e)) return false;
|
---|
| 15 | }, true) !== false;
|
---|
| 16 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.