UNPKG

jsmodern

Version:

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

16 lines 473 B
import { utilIsSet } from './is-set'; export const isDisjoint = { label: 'isDisjoint', fn: function setIsDisjoint(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-disjoint.js.map