mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
6 lines
272 B
TypeScript
6 lines
272 B
TypeScript
export default function getFilterValue<FilterType>(filterValues: ReadonlyArray<FilterType>, val: string | Array<string> | undefined): FilterType | undefined {
|
|
if (typeof val === 'string' && filterValues.includes(val as FilterType)) {
|
|
return val as FilterType;
|
|
}
|
|
}
|