]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/helpers/custom-validators/feeds.ts
fa35a7da6c072b0234a1b2b4101fccfd050da382
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / feeds.ts
1 import { exists } from './misc'
2
3 function isValidRSSFeed (value: string) {
4 if (!exists(value)) return false
5
6 const feedExtensions = [
7 'xml',
8 'json',
9 'json1',
10 'rss',
11 'rss2',
12 'atom',
13 'atom1'
14 ]
15
16 return feedExtensions.includes(value)
17 }
18
19 // ---------------------------------------------------------------------------
20
21 export {
22 isValidRSSFeed
23 }