12 lines
353 B
TypeScript
12 lines
353 B
TypeScript
import {ComAtprotoLabelDefs} from '@atproto/api'
|
|
import {LabelValGroup, LABEL_VAL_GROUPS} from './const'
|
|
|
|
export function getLabelValueGroup(labelVal: string): LabelValGroup {
|
|
for (const id in LABEL_VAL_GROUPS) {
|
|
if (LABEL_VAL_GROUPS[id].values.includes(labelVal)) {
|
|
return LABEL_VAL_GROUPS[id]
|
|
}
|
|
}
|
|
return LABEL_VAL_GROUPS.unknown
|
|
}
|