PeerTube/server/helpers/custom-validators/feeds.ts

24 lines
377 B
TypeScript
Raw Normal View History

import { exists } from './misc'
function isValidRSSFeed (value: string) {
if (!exists(value)) return false
const feedExtensions = [
'xml',
'json',
'json1',
'rss',
'rss2',
'atom',
'atom1'
]
2020-02-28 16:03:39 +01:00
return feedExtensions.includes(value)
}
// ---------------------------------------------------------------------------
export {
isValidRSSFeed
}