Include invalid references as targets for find all references

For #146277
This commit is contained in:
Matt Bierner
2022-03-30 14:33:01 -07:00
parent 17783a09e5
commit d441406b1e
3 changed files with 80 additions and 57 deletions

View File

@@ -15,4 +15,11 @@ export function equals<T>(one: ReadonlyArray<T>, other: ReadonlyArray<T>, itemEq
}
return true;
}
}
/**
* @returns New array with all falsy values removed. The original array IS NOT modified.
*/
export function coalesce<T>(array: ReadonlyArray<T | undefined | null>): T[] {
return <T[]>array.filter(e => !!e);
}