mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 17:25:54 -05:00
Adds error messages for failed operations
Adds showHistory command support to CodeLens Fixes and improve the showHistory explorer Refactoring
This commit is contained in:
@@ -43,6 +43,12 @@ export namespace Iterables {
|
||||
return typeof source[Symbol.iterator] === 'function';
|
||||
}
|
||||
|
||||
export function last<T>(source: Iterable<T>): T {
|
||||
let item: T;
|
||||
for (item of source) { /* noop */ }
|
||||
return item;
|
||||
}
|
||||
|
||||
export function* map<T, TMapped>(source: Iterable<T> | IterableIterator<T>, mapper: (item: T) => TMapped): Iterable<TMapped> {
|
||||
for (const item of source) {
|
||||
yield mapper(item);
|
||||
|
||||
Reference in New Issue
Block a user