UNPKG

set.prototype.difference

Version:

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

19 lines (14 loc) 390 B
'use strict'; var getPolyfill = require('./polyfill'); var define = require('define-properties'); var shimSet = require('es-set/shim'); module.exports = function shimSetDifference() { shimSet(); var polyfill = getPolyfill(); define( Set.prototype, { difference: polyfill }, { difference: function () { return Set.prototype.difference !== polyfill; } } ); return polyfill; };