How to use the es6-iterator.call function in es6-iterator

To help you get started, we’ve selected a few es6-iterator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github medikoo / dbjs / _setup / 2.multiple-item / iterator.js View on Github external
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);
github medikoo / es6-set / lib / iterator.js View on Github external
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);
github angelozerr / tern.java / core / ternjs / node_modules / tern-eslint / node_modules / eslint / node_modules / es6-map / lib / primitive-iterator.js View on Github external
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);
github medikoo / es6-map / lib / primitive-iterator.js View on Github external
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);
github angelozerr / tern.java / core / ternjs / node_modules / tern-eslint / node_modules / eslint / node_modules / es6-map / lib / iterator.js View on Github external
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);
github medikoo / dbjs / _setup / 1.property / iterator.js View on Github external
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);
github medikoo / es6-set / lib / primitive-iterator.js View on Github external
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);
github medikoo / dbjs / _setup / 3.descriptor-property / iterator.js View on Github external
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);
github medikoo / es6-map / lib / iterator.js View on Github external
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);

es6-iterator

Iterator abstraction based on ES6 specification

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis