@tsdotnet/linq
Version:
A familiar set of functions that operate on JavaScript iterables (ES2015+) in a similar way to .NET's LINQ does with enumerables.
20 lines (17 loc) • 490 B
JavaScript
import { ArgumentNullException } from '@tsdotnet/exceptions';
function iterateIndexes(source) {
if (!source)
throw new ArgumentNullException('source');
return {
*[Symbol.iterator]() {
const len = source?.length;
if (len) {
for (let i = 0; i < len; i++) {
yield source[i];
}
}
}
};
}
export { iterateIndexes as default };
//# sourceMappingURL=iterateIndexes.js.map