aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/helpers/custom-validators/feeds.ts
blob: 638e814f03e36a7617a8d937600877cd8516ef27 (plain) (tree)






















                                                                              
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
}