I have a tuple with multiple objects stored in it.
const repos = [
{ name: 'react', type: 'JS' },
{ name: 'angular', type: 'TS' },
] as const
const RepoTypes = typeof repos
const jsRepoTypes = FilterRepos<'JS'> // Expected to filter and return only the JS type object
I am interested in a generic Utility Type ( FilterRepos<T>
) where I can input the type
parameter and receive the filtered tuple type.