aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/feeds.ts
blob: fa35a7da6c072b0234a1b2b4101fccfd050da382 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { exists } from './misc'

function isValidRSSFeed (value: string) {
  if (!exists(value)) return false

  const feedExtensions = [
    'xml',
    'json',
    'json1',
    'rss',
    'rss2',
    'atom',
    'atom1'
  ]

  return feedExtensions.includes(value)
}

// ---------------------------------------------------------------------------

export {
  isValidRSSFeed
}