@tsdotnet/collection-base
Version:
[](https://github.com/tsdotnet/collection-base/blob/master/LICENSE)  [![npm ve
21 lines • 592 B
JavaScript
/*!
* @author electricessence / https://github.com/electricessence/
* @license MIT
*/
import ArgumentNullException from '@tsdotnet/exceptions/dist/ArgumentNullException';
/**
* Copies all values to a numerically indexable object.
* @param {Iterable} source
* @param target
* @param {number?} index
* @returns target
*/
export default function copyIterableTo(source, target, index = 0) {
if (!target)
throw new ArgumentNullException('target');
for (const e of source) {
target[index++] = e;
}
return target;
}
//# sourceMappingURL=copyIterableTo.js.map