選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

utils.ts 280B

123456789101112
  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. }