1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-05 14:24:28 +00:00
Funkin/source/funkin/util/tools/IteratorTools.hx
2023-01-22 22:25:45 -05:00

17 lines
376 B
Haxe

package funkin.util.tools;
/**
* A static extension which provides utility functions for Iterators.
*
* For example, add `using IteratorTools` then call `iterator.array()`.
*
* @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];
}
}