dify/web/app/components/plugins/utils.ts
2024-11-25 12:03:49 +08:00

13 lines
280 B
TypeScript

import {
categoryKeys,
tagKeys,
} from './constants'
export const getValidTagKeys = (tags: string[]) => {
return tags.filter(tag => tagKeys.includes(tag))
}
export const getValidCategoryKeys = (category?: string) => {
return categoryKeys.find(key => key === category)
}