mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-30 11:26:53 -05:00
17 lines
365 B
Haxe
17 lines
365 B
Haxe
|
package funkin.util;
|
||
|
|
||
|
/**
|
||
|
* 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];
|
||
|
}
|
||
|
}
|