1
0
Fork 0
peertube/server/helpers/custom-validators/feeds.ts
2020-02-28 16:21:34 +01:00

23 lines
377 B
TypeScript

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
}