Init commit
This commit is contained in:
23
server/core/helpers/custom-validators/feeds.ts
Normal file
23
server/core/helpers/custom-validators/feeds.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { exists } from './misc.js'
|
||||
|
||||
function isValidRSSFeed (value: string) {
|
||||
if (!exists(value)) return false
|
||||
|
||||
const feedExtensions = [
|
||||
'xml',
|
||||
'json',
|
||||
'json1',
|
||||
'rss',
|
||||
'rss2',
|
||||
'atom',
|
||||
'atom1'
|
||||
]
|
||||
|
||||
return feedExtensions.includes(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isValidRSSFeed
|
||||
}
|
||||
Reference in New Issue
Block a user