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

Package detail

set.prototype.symmetricdifference

es-shims7.5kMIT1.1.3

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

javascript, ecmascript, polyfill, shim, Set, symmetricDifference, symmetric, difference, Set.prototype.symmetricDifference, es-shims, es-shim API

readme

set.prototype.symmetricdifference Version Badge

github actions coverage License Downloads

npm badge

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

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

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

symmetricDifference.shim();

var shimmedResult = set1.symmetricDifference(set2);
assert.deepEqual(shimmedResult, new Set([1, 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-06

Commits

v1.1.2 - 2024-03-16

Commits

  • [meta] remove useless ESM 55b8277
  • [Refactor] replace es-abstract with es-object-atoms; update call-bind, is-set 32ff4d7
  • [Dev Deps] update tape b2ecdff

v1.1.1 - 2024-02-05

Commits

  • [Tests] increase coverage 3a05e21
  • [Refactor] use es-errors, so things that only need those do not need get-intrinsic 0cefa0e
  • [Deps] update call-bind, define-properties, es-abstract, es-set, get-intrinsic 5e4a67f
  • [Dev Deps] update aud, npmignore, object-inspect, tape b63d3f4
  • [Tests] only run the native tests with the native run f0e874f
  • [Dev Deps] update tape 36ce9ac

v1.1.0 - 2023-07-18

Commits

  • [patch] remove GetKeysIterator and its callable check 78b47cd
  • [Deps] update define-properties, es-abstrct, get-intrinsic c95890c
  • [Tests] remove unused shimmed tests 7dbe568
  • [patch] throw on negative set sizes a7c2506
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, es6-shim, tape b71ef6e

v1.0.2 - 2023-01-14

Commits

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

v1.0.1 - 2023-01-13

Commits

  • [Fix] properly handle StopIteration envs, like FF 42 37e5651
  • [readme] link to all set method packages 6eb3618
  • [Deps] update es-abstract, es-set f6c0f42
  • [Dev Deps] update @ljharb/eslint-config, object-inspect 67359e8
  • [Deps] update es-abstract, es-set 3d90551
  • [Dev Deps] update aud, es6-shim c0d31e9

v1.0.0 - 2022-12-05

Commits