utils.ts 280 B

12345678910111213
  1. import {
  2. categoryKeys,
  3. tagKeys,
  4. } from './constants'
  5. export const getValidTagKeys = (tags: string[]) => {
  6. return tags.filter(tag => tagKeys.includes(tag))
  7. }
  8. export const getValidCategoryKeys = (category?: string) => {
  9. return categoryKeys.find(key => key === category)
  10. }