aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/feeds.ts
blob: 638e814f03e36a7617a8d937600877cd8516ef27 (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.indexOf(value) !== -1
}

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

export {
  isValidRSSFeed
}