mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +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;
|
|
}
|
|
}
|