Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function iterate (map: SortedMapStructure): IterableIterator, V>> {
return iterateFromFirst(map._sorted);
}
export function iteratePairs (map: SortedMapStructure): IterableIterator<[K, V]> {
return new MappableIterator, V>, [K, V]>(iterateFromFirst(map._sorted), toPair);
}
export function isEqual (set: SortedSetStructure, other: SortedSetStructure): boolean {
if(set === other) return true;
if(size(set) !== size(other) ||
set._select !== other._select ||
set._compare !== other._compare) return false;
var a = set._tree, b = other._tree;
var ita = iterateFromFirst(a), itb = iterateFromFirst(b);
do {
var ca = ita.next();
var cb = itb.next();
if(!equals(ca.value.value, cb.value.value)) return false;
} while(!ca.done);
return true;
}
export function isEqual (set: SortedMapStructure, other: SortedMapStructure): boolean {
if(set === other) return true;
if(size(set) !== size(other) ||
set._select !== other._select ||
set._compare !== other._compare) return false;
var a = set._sorted, b = other._sorted;
var ita = iterateFromFirst(a), itb = iterateFromFirst(b);
do {
var ca = ita.next();
var cb = itb.next();
if(!equals(ca.value.value, cb.value.value)) return false;
} while(!ca.done);
return true;
}
export function iterateKeys (map: SortedMapStructure): IterableIterator {
return new MappableIterator, K>(keys(map._sorted), toKey);
}
export function iterate (set: SortedSetStructure): IterableIterator> {
return keys(set._tree);
}
export function iterateValues (set: SortedSetStructure): IterableIterator {
return new MappableIterator, T>(keys(set._tree), valueOf);
}
export function size (map: SortedMapStructure): number {
return _size(map._sorted);
}
export function size (set: SortedSetStructure): number {
return _size(set._tree);
}
export function get (index: number, set: SortedSetStructure): T|undefined {
var entry = keyAt(index, set._tree);
return isUndefined(entry) ? void 0 : entry.value;
}