Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (t, a) {
var proto = create(Set.prototype), initialized, set, event;
t(proto, function () { initialized = true; });
set = create(proto);
set = proto.constructor.call(set);
set.add('foo');
a(initialized, undefined, "Not observable");
set.on('foo', function () {});
a(initialized, undefined, "Not 'change' listener");
set.on('change', function (e) { event = e; });
a(initialized, true, "'change' listener");
set.add('raz');
set._emitAdd_('raz');
a.deep(event, { type: 'add', value: 'raz', target: set }, "Event");
, setGetLast = require('es6-set/ext/get-last')
, setCopy = require('es6-set/ext/copy')
, setEvery = require('es6-set/ext/every')
, setSome = require('es6-set/ext/some')
, createReadOnly = require('observable-set/create-read-only')
, createObservable = require('observable-set/create-complete')
, serializeObject = require('./serialize/object')
, defFilterByKey = require('./utils/define-filter-by-key')
, propertyIsEnumerable = Object.prototype.propertyIsEnumerable, keys = Object.keys
, ObjectsSet;
ObjectsSet = function () { return setPrototypeOf(new PrimitiveSet(), ObjectsSet.prototype); };
setPrototypeOf(ObjectsSet, PrimitiveSet);
ObjectsSet.prototype = Object.create(PrimitiveSet.prototype, {
constructor: d(ObjectsSet),
_serialize: d(serializeObject),
getById: d(function (id) { return this.__setData__[id] || null; }),
_plainForEach_: d(function (cb/*, thisArg*/) {
var thisArg = arguments[1];
keys(this.__setData__).forEach(function (key) {
if (!propertyIsEnumerable.call(this, key)) return;
cb.call(thisArg, this[key]);
}, this.__setData__);
})
});
defFilterByKey(ObjectsSet.prototype);
module.exports = createReadOnly(createObservable(ObjectsSet));
Object.defineProperties(module.exports.prototype, {