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

Package detail

set.prototype.issupersetof

es-shims3kMIT1.1.3

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

javascript, ecmascript, polyfill, shim, Set, Set.prototype.isSupersetOf, isSupersetOf, superset, es-shim API, es-shims

readme

set.prototype.issupersetof Version Badge

github actions coverage License Downloads

npm badge

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

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

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

isSupersetOf.shim();

assert.equal(set1.isSupersetOf(set2), false);
assert.equal(set2.isSupersetOf(set1), false);
assert.equal(set1.isSupersetOf(set3), 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.3 - 2024-04-06

Commits

v1.1.2 - 2024-03-19

Commits

  • [meta] remove useless ESM b8ca68c
  • [Deps] update call-bind, es-abstract, es-errors, is-set ee159df
  • [actions] remove redundant finisher 307c80f
  • [Dev Deps] update tape c562c44

v1.1.1 - 2024-02-04

Commits

  • [Tests] increase coverage 26547ae
  • [Tests] ensure test mocks return iterators d1a89d3
  • [Tests] increase coverage 3182aa6
  • [Refactor] use es-errors, so things that only need those do not need get-intrinsic 1367361
  • [Deps] update call-bind, define-properties, es-abstract, es-set, get-intrinsic 0b2b950
  • [Dev Deps] update aud, npmignore, object-inspect, tape dd80031
  • [Dev Deps] update tape 887b424

v1.1.0 - 2023-07-18

Commits

  • [patch] remove GetKeysIterator and its callable check 9e0f82f
  • [Deps] update define-properties, es-abstract, get-intrinsic 4f2e788
  • [patch] throw on negative set sizes 932548f
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, es6-shim, tape ac8c1b5

v1.0.2 - 2023-01-15

Commits

  • [Fix] properly handle StopIteration envs, like FF 42 c989d58
  • [Dev Deps] update object-inspect bfc1d3e

v1.0.1 - 2023-01-11

Commits

  • [Fix] handle node 2, where Set needs polyfilling, thus there are two potential has/size methods 1a255f5
  • [readme] link to all set method packages 2198eaa
  • [Tests] add missing builtin-shimmed tests 56c18d4
  • [Fix] close the iterator 832b901
  • [Deps] update es-abstract, es-set 2703b39
  • [Dev Deps] update aud, es6-shim 5d3426b
  • [Deps] update es-abstract 2f94029
  • [Dev Deps] update @ljharb/eslint-config 31ea244

v1.0.0 - 2022-12-05

Commits