blob: 0154a242432b1bf43b6bc35ab94bb105864f82e8 (
plain) (
tree)
|
|
'use strict'
const validator = require('express-validator').validator
const miscValidators = require('./misc')
const podsValidators = {
isEachUniqueHostValid
}
function isEachUniqueHostValid (hosts) {
return miscValidators.isArray(hosts) &&
hosts.length !== 0 &&
hosts.every(function (host) {
return validator.isURL(host) && host.split('://').length === 1 && hosts.indexOf(host) === hosts.lastIndexOf(host)
})
}
// ---------------------------------------------------------------------------
module.exports = podsValidators
|