move identity function to utils
This commit is contained in:
@@ -12,6 +12,10 @@ export function asArray<T>(iterable: Iterable<T>) {
|
||||
return Array.isArray(iterable) ? <T[]>iterable : Array.from(iterable);
|
||||
}
|
||||
|
||||
export function identity<T>(obj: T) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
class WrappedAsyncIterator<T> implements AsyncIterable<T> {
|
||||
readonly #iterator: AsyncIterator<T>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user