jsmodern
Version:
An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.
16 lines • 477 B
JavaScript
import { utilIsSet } from './is-set.js';
export const isSuperset = {
label: 'isSuperset',
fn: function setIsSuperset(other) {
const ctx = this;
if (!utilIsSet(other))
throw new TypeError(`Expect 'other' to be a Set`);
if (!ctx.size && !other.size)
return true;
for (const n of other)
if (!ctx.has(n))
return false;
return true;
},
};
//# sourceMappingURL=is-superset.js.map