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

Package detail

set.prototype.issubsetof

es-shims1.6kMIT1.1.4

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

javascript, ecmascript, Set, isSubsetOf, Set.prototype.isSubsetOf, subset, polyfill, shim, es-shim API, es-shims

readme

set.prototype.issubsetof Version Badge

github actions coverage License Downloads

npm badge

ES Proposal spec-compliant shim for Set.prototype.isSubsetOf. Invoke its "shim" method to shim Set.prototype.isSubsetOf 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 isSubsetOf = require('set.prototype.issubsetof');

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

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

isSubsetOf.shim();

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

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.4 - 2024-04-06

Commits

v1.1.3 - 2024-03-18

Commits

  • [meta] remove useless ESM 819d070
  • [Deps] update call-bind, es-abstract, is-set 6066362
  • [actions] remove redundant finisher 20f0425
  • [Refactor] add SetDataSize 61639c8
  • [Dev Deps] update has-property-descriptors, tape 56ac1ef

v1.1.2 - 2024-02-05

Commits

  • [Refactor] use es-errors, so things that only need those do not need get-intrinsic 1582ab2
  • [Tests] ensure test mocks return iterators c791d83
  • [Dev Deps] update tape d8d9faa

v1.1.1 - 2023-12-18

Commits

  • [Tests] increase coverage b96162b
  • [Tests] add coverage d344bb0
  • [Tests] improve coverage 6e60d6e
  • [Tests] increase coverage 21b0b76
  • [Refactor] more closely match the spec 0a5937f
  • [Deps] update call-bind, define-properties, es-abstract, es-set, get-intrinsic e70f8f0
  • [Dev Deps] update aud, npmignore a826681
  • [Dev Deps] update object-inspect, tape 56617c7
  • [Tests] increase coverage c4bc977

v1.1.0 - 2023-07-18

Commits

  • [Tests] remove unused shimmed tests 93a2e69
  • [Deps] update define-properties, es-abstract, get-intrinsic 98212d4
  • [patch] throw on negative set sizes 71a86f0
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, es6-shim, tape 4de4433

v1.0.1 - 2023-01-14

Commits

  • [Fix] properly handle StopIteration envs, like FF 42 ca8c496
  • [readme] link to all set method packages 9be5cf8
  • [Deps] update es-abstract, es-set 01b188a
  • [Dev Deps] update @ljharb/eslint-config, object-inspect 02fca02
  • [Deps] update es-abstract, es-set eb0e34f
  • [Dev Deps] update aud, es6-shim 552172b

v1.0.0 - 2022-12-05

Commits