Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

set.prototype.isdisjointfrom

es-shims718MIT1.1.5

An ESnext spec-compliant Set.prototype.isDisjointFrom shim/polyfill/replacement that works as far down as ES3

javascript, ecmascript, polyfill, shim, Set, Set.prototype.isDisjointFrom, isDisjointFrom, disjoint, es-shim API, es-shims

readme

set.prototype.isdisjointfrom Version Badge

github actions coverage License Downloads

npm badge

ES Proposal spec-compliant shim for Set.prototype.isDisjointFrom. Invoke its "shim" method to shim Set.prototype.isDisjointFrom if it is unavailable or noncompliant.

This package implements the es-shim API interface. It works in an ES3-supported environment, and complies with the proposed spec. When shimmed, it uses es-set to shim the Set implementation itself if needed.

Most common usage:

var assert = require('assert');
var isDisjointFrom = require('set.prototype.isdisjointfrom');

var set1 = new Set([1, 2]);
var set2 = new Set([2, 3]);
var set3 = new Set([1]);

assert.equal(isDisjointFrom(set1, set2), false);
assert.equal(isDisjointFrom(set2, set1), false);
assert.equal(isDisjointFrom(set1, set3), false);
assert.equal(isDisjointFrom(set2, set3), true);
assert.equal(isDisjointFrom(set3, set2), true);

isDisjointFrom.shim();

assert.equal(set1.isDisjointFrom(set2), false);
assert.equal(set2.isDisjointFrom(set1), false);
assert.equal(set1.isDisjointFrom(set3), false);
assert.equal(set2.isDisjointFrom(set3), true);
assert.equal(set3.isDisjointFrom(set2), true);

Compatibility

node v22 and equivalent versions of Chrome have Set isDisjointFrom, but has a bug with set-like arguments with non-SMI integer sizes.

Tests

Simply clone the repo, npm install, and run npm test

Set Method Packages

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.1.5 - 2024-09-10

Commits

  • [Fix] handle chrome/v8 bugs 0b0b430
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, object-inspect, tape d9c8f69
  • [Refactor] change internal slot name a8291f4
  • [Tests] replace aud with npm audit 64c89f7
  • [Dev Deps] add missing peer dep 67fa3e5

v1.1.4 - 2024-04-06

Commits

v1.1.3 - 2024-03-20

Commits

  • [meta] remove useless ESM 1a0b593
  • [Deps] update call-bind, es-abstract, es-errors, is-set c29446c
  • [actions] remove redundant finisher 49ef08c
  • [Refactor] add SetDataSize 1cbafc8
  • [Dev Deps] update tape 97f15a0

v1.1.2 - 2024-02-04

Commits

  • [Tests] increase coverage 2c2423d
  • [Refactor] use es-errors where possible, so things that only need those do not need get-intrinsic 9429f04
  • [Tests] ensure test mocks return iterators 4ff1976
  • [Dev Deps] update tape f7f2310

v1.1.1 - 2023-12-18

Commits

  • [Tests] increase coverage 0aebafc
  • [Refactor] more closely match the spec 6482da1
  • [Deps] update call-bind, define-properties, es-abstract, get-intrinsic 3f913f6
  • [Dev Deps] update aud, npmignore, object-inspect, tape e0deadc
  • [Tests] increase coverage d520eb5
  • [Deps] update es-set a3677d6
  • [Dev Deps] update tape db4010a

v1.1.0 - 2023-07-18

Commits

  • [patch] remove GetKeysIterator and its callable check fd7dbd3
  • [Deps] update define-properties, es-abstract, get-intrinsic 0b607b1
  • [patch] throw on negative set sizes 8a1abdc
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, es6-shim, tape a535197

v1.0.2 - 2023-01-14

Commits

  • [Refactor] update es-set; use es-set/tools e33e822
  • [Fix] properly handle StopIteration envs, like FF 42 a046da5
  • [Deps] update es-set 3617eaa
  • [Dev Deps] update object-inspect 4d3bb22

v1.0.1 - 2023-01-11

Commits

  • [Fix] handle node 2, where Set needs polyfilling, thus there are two potential has/size/forEach methods 03b25e8
  • [readme] link to all set method packages 224c2ba
  • [Tests] add missing builtin-shimmed tests 2a59bc6
  • [Fix] close the iterator 1baeb5d
  • [Deps] update es-abstract, es-set a73db42
  • [Dev Deps] update aud, es6-shim 39cdb81
  • [Deps] update es-abstract a49f0d3
  • [Dev Deps] update @ljharb/eslint-config 425cbba

v1.0.0 - 2022-12-05

Commits