Skip to content

Commit

Permalink
Add new iterable method
Browse files Browse the repository at this point in the history
  • Loading branch information
bamless committed Dec 12, 2023
1 parent 2390bc4 commit 44c5ada
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Binary file modified src/lib/core/iter.jsc
Binary file not shown.
4 changes: 4 additions & 0 deletions src/lib/core/iter.jsr
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ class Iterable
return interleave(this, sep)
end

fun repeat(n=0)
return repeat(this).take(n).flatten() if n != 0 else repeat(this).flatten()
end

fun sorted(comparator=null)
return sorted(this, comparator)
end
Expand Down

0 comments on commit 44c5ada

Please sign in to comment.