Funkin/source/funkin/util/tools/IteratorTools.hx

17 lines
374 B
Haxe
Raw Normal View History

package funkin.util.tools;
/**
* A static extension which provides utility functions for Iterators.
2023-06-08 16:30:45 -04:00
*
* For example, add `using IteratorTools` then call `iterator.array()`.
2023-06-08 16:30:45 -04:00
*
* @see https://haxe.org/manual/lf-static-extension.html
*/
class IteratorTools
{
public static function array<T>(iterator:Iterator<T>):Array<T>
{
return [for (i in iterator) i];
}
}