iteragain
Advanced tools
Comparing version 3.12.0 to 3.12.1
@@ -485,3 +485,3 @@ "use strict"; | ||
/** Collects all values from this iterator, then sorts them. */ | ||
sort(comparator) { | ||
sort(comparator = (a, b) => a < b ? -1 : a > b ? 1 : 0) { | ||
this.iterator = (0, toIterator_1.default)(this.toArray().sort(comparator)); | ||
@@ -488,0 +488,0 @@ return this; |
{ | ||
"name": "iteragain", | ||
"version": "3.12.0", | ||
"version": "3.12.1", | ||
"description": "Javascript Iterable/Iterator/Generator-function utilities.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** Collects all values from the input iterator, then sorts them. */ | ||
function sort(arg, comparator) { | ||
function sort(arg, comparator = (a, b) => a < b ? -1 : a > b ? 1 : 0) { | ||
return (0, toArray_1.default)(arg).sort(comparator)[Symbol.iterator](); | ||
@@ -9,0 +9,0 @@ } |
275765