Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
MultiplePropertyIterator = module.exports = function (set, kind) {
var sKey, sKeys, data;
if (!(this instanceof MultiplePropertyIterator)) {
return new MultiplePropertyIterator(set, kind);
}
sKeys = [];
data = set.__setData__;
for (sKey in data) {
if ((typeof data[sKey] !== 'number') && !data[sKey]._value_) continue;
sKeys.push(sKey);
}
Iterator.call(this, sKeys.sort(byLastModified.bind(data)));
kind = (!kind || !contains.call(kind, 'key+value')) ? 'value' : 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__set__: d('w', set)
});
set.object._getMultipleIterators_(set.__pSKey__).push(this);
};
if (setPrototypeOf) setPrototypeOf(MultiplePropertyIterator, Iterator);
SetIterator = module.exports = function (set, kind) {
if (!(this instanceof SetIterator)) return new SetIterator(set, kind);
Iterator.call(this, set.__setData__, set);
if (!kind) kind = 'value';
else if (contains.call(kind, 'key+value')) kind = 'key+value';
else kind = 'value';
defineProperty(this, '__kind__', d('', kind));
};
if (setPrototypeOf) setPrototypeOf(SetIterator, Iterator);
PrimitiveMapIterator = module.exports = function (map, kind) {
if (!(this instanceof PrimitiveMapIterator)) {
return new PrimitiveMapIterator(map, kind);
}
Iterator.call(this, keys(map.__mapKeysData__), map);
if (!kind || !kinds[kind]) kind = 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__keysData__: d('w', map.__mapKeysData__),
__valuesData__: d('w', map.__mapValuesData__)
});
};
if (setPrototypeOf) setPrototypeOf(PrimitiveMapIterator, Iterator);
PrimitiveMapIterator = module.exports = function (map, kind) {
if (!(this instanceof PrimitiveMapIterator)) {
return new PrimitiveMapIterator(map, kind);
}
Iterator.call(this, keys(map.__mapKeysData__), map);
if (!kind || !kinds[kind]) kind = 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__keysData__: d('w', map.__mapKeysData__),
__valuesData__: d('w', map.__mapValuesData__)
});
};
if (setPrototypeOf) setPrototypeOf(PrimitiveMapIterator, Iterator);
MapIterator = module.exports = function (map, kind) {
if (!(this instanceof MapIterator)) return new MapIterator(map, kind);
Iterator.call(this, map.__mapKeysData__, map);
if (!kind || !kinds[kind]) kind = 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__values__: d('w', map.__mapValuesData__)
});
};
if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator);
sKeys = [];
data = map.__descriptors__;
for (sKey in data) {
if (data[sKey]._hasValue_(map)) sKeys.push(sKey);
}
desc = map.__descriptorPrototype__;
if (desc.nested) {
for (sKey in map.__objects__) {
if (!data[sKey]) sKeys.push(sKey);
}
} else if (desc.multiple) {
for (sKey in map.__sets__) {
if (!data[sKey]) sKeys.push(sKey);
}
}
Iterator.call(this, sKeys);
if (!kind || !kinds[kind]) kind = 'key+value';
modifiedMap = create(null);
defineProperties(this, {
__kind__: d('', kind),
__map__: d('w', map),
__modifiedMap__: d('', modifiedMap),
__compareFn__: d('', getCompareByLastModified(map, modifiedMap))
});
if (this.__list__.some(function (sKey) {
return (modifiedMap[sKey] = this._getPropertyLastModified_(sKey));
}, map)) {
this.__list__.sort(this.__compareFn__);
}
map._iterators_.push(this);
};
if (setPrototypeOf) setPrototypeOf(ObjectIterator, Iterator);
PrimitiveSetIterator = module.exports = function (set, kind) {
if (!(this instanceof PrimitiveSetIterator)) {
return new PrimitiveSetIterator(set, kind);
}
Iterator.call(this, keys(set.__setData__), set);
kind = (!kind || !contains.call(kind, 'key+value')) ? 'value' : 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__data__: d('w', set.__setData__)
});
};
if (setPrototypeOf) setPrototypeOf(PrimitiveSetIterator, Iterator);
DescriptorIterator = module.exports = function (map, kind) {
var sKey, sKeys, data;
if (!(this instanceof DescriptorIterator)) {
return new DescriptorIterator(map, kind);
}
sKeys = [];
data = map.__descriptors__;
for (sKey in data) {
if (data[sKey]._hasValue_()) sKeys.push(sKey);
}
Iterator.call(this, sKeys.sort(byLastModified.bind(data)));
if (!kind || !kinds[kind]) kind = 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__map__: d('w', map)
});
map.object._getDescriptorIterators_(map._sKey_).push(this);
};
if (setPrototypeOf) setPrototypeOf(DescriptorIterator, Iterator);
MapIterator = module.exports = function (map, kind) {
if (!(this instanceof MapIterator)) return new MapIterator(map, kind);
Iterator.call(this, map.__mapKeysData__, map);
if (!kind || !kinds[kind]) kind = 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__values__: d('w', map.__mapValuesData__)
});
};
if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator);