1
0
This commit is contained in:
2024-05-07 15:11:57 +02:00
parent a172e6a50f
commit f9790ab05c
8 changed files with 18 additions and 60 deletions

View File

@@ -54,8 +54,7 @@ export function defaultArrayComparer<T>(a: T, b: T) {
return -1;
}
const aStr = a === null ? "null" : a.toString();
const bStr = b === null ? "null" : b.toString();
const aStr = `${a}`, bStr = `${b}`;
return aStr > bStr ? 1 : aStr < bStr ? -1 : 0;
}
@@ -81,7 +80,7 @@ export function* asGenerator<T>(iterator: Iterator<T>) {
const next = iterator.next();
if (next.done) {
break;
return next.value;
}
yield next.value;
@@ -93,7 +92,7 @@ export async function* asAsyncGenerator<T>(iterator: MaybeAsyncIterator<T>) {
const next = await iterator.next();
if (next.done) {
break;
return next.value;
}
yield next.value;