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

Package detail

set.prototype.union

es-shims56.4kMIT1.1.3

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

javascript, ecmascript, Set, union, set.prototype.union, polyfill, shim, es-shim API, es-shims

readme

set.prototype.union Version Badge

github actions coverage License Downloads

npm badge

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

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

assert.deepEqual(result, new Set([1, 2, 3]));

union.shim();

var shimmedResult = set1.union(set2);
assert.deepEqual(shimmedResult, new Set([1, 2, 3]));

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-10

Commits

v1.1.2 - 2024-03-16

Commits

  • [Refactor] use es-object-atoms, update es-abstract 35ac9d7
  • [Deps] update call-bind, es-errors, get-intrinsic, is-set 31638f7
  • [Dev Deps] update tape 4d5a98b

v1.1.1 - 2024-02-04

Commits

  • [Tests] increase coverage 7740390
  • [Refactor] use es-errors where possible, so things that only need those do not need get-intrinsic 73ed79e
  • [Deps] update call-bind, define-properties, es-abstract, es-set, get-intrinsic ea4a699
  • [Dev Deps] update aud, es-map, npmignore, object-inspect, tape 8ab39da
  • [Dev Deps] update tape 8c149f9

v1.1.0 - 2023-07-18

Commits

  • [Deps] update es-abstract 0d962d0
  • [patch] remove GetKeysIterator and its callable check 4bf3ce8
  • [patch] throw on negative set sizes 09b9244
  • [Dev Deps] update tape e16220c

v1.0.3 - 2023-06-21

Commits

  • [Fix] use ES2023 implementation of IteratorStep eb67bab
  • [Tests] add passing tests b997840
  • [Tests] add missing test file 768791f
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, es6-shim 2b45570
  • [Deps] update define-properties, es-abstract, get-intrinsic 8282b47
  • [Dev Deps] update @es-shims/api, tape 6e7c35c
  • [Deps] update get-intrinsic 605cd00
  • [Dev Deps] update aud e81245d

v1.0.2 - 2023-01-14

Commits

  • [Refactor] update es-set; use es-set/tools eeea463

v1.0.1 - 2023-01-13

Commits

  • [Fix] properly handle StopIteration envs, like FF 42 690021d
  • [readme] link to all set method packages ff16cc8
  • [Tests] remove unused test file fdb1bb2
  • [Dev Deps] update @ljharb/eslint-config, object-inspect c4a1631
  • [Deps] update es-abstract, es-set 0c32058
  • [Deps] update es-abstract, es-set a405550
  • [Dev Deps] update aud, es6-shim 3934871
  • [meta] fix package description 3b99b5e

v1.0.0 - 2022-12-02

Commits