mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 15:01:57 +01:00
remove Resource from git model method interfaces
This commit is contained in:
@@ -162,4 +162,19 @@ export function uniqueFilter<T>(keyFn: (t: T) => string): (t: T) => boolean {
|
||||
seen[key] = true;
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
export function find<T>(array: T[], fn: (t: T) => boolean): T | undefined {
|
||||
let result: T | undefined = undefined;
|
||||
|
||||
array.some(e => {
|
||||
if (fn(e)) {
|
||||
result = e;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user