UNPKG

jsmodern

Version:

An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.

16 lines 469 B
import { utilIsSet } from './is-set.js'; export const isSubset = { label: 'isSubset', fn: function setIsSubset(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 ctx) if (!other.has(n)) return false; return true; }, }; //# sourceMappingURL=is-subset.js.map