1
0
Fork 0
peertube/server/helpers/custom-validators/activitypub/misc.ts
2017-11-27 19:40:51 +01:00

17 lines
352 B
TypeScript

import { exists } from '../misc'
function isActivityPubUrlValid (url: string) {
const isURLOptions = {
require_host: true,
require_tld: true,
require_protocol: true,
require_valid_protocol: true,
protocols: [ 'http', 'https' ]
}
return exists(url) && validator.isURL(url, isURLOptions)
}
export {
isActivityPubUrlValid
}