index.js
function _isValidNodeURI(nodeURI) {
  if (!_isString(nodeURI)) return false

  try {
    let isValidURI = isURL(nodeURI, {
      protocols: ['http', 'https'],
      require_protocol: true,
      host_blacklist: ['0.0.0.0']
    })

    let parsedURI = url.parse(nodeURI).hostname

    // Valid URI w/ IPv4 address?
    return isValidURI && isIP(parsedURI, 4)
  } catch (error) {
    return false
  }
}
function _isValidNodeURI(nodeURI) {
  if (!_isString(nodeURI)) return false

  try {
    let isValidURI = isURL(nodeURI, {
      protocols: ['http', 'https'],
      require_protocol: true,
      host_blacklist: ['0.0.0.0']
    })

    let parsedURI = url.parse(nodeURI).hostname

    // Valid URI w/ IPv4 address?
    return isValidURI && isIP(parsedURI, 4)
  } catch (error) {
    return false
  }
}
function _isValidNodeURI ( nodeURI ) { if ( ! _isString ( nodeURI ) ) return false try { let isValidURI = isURL ( nodeURI , { protocols : [ 'http' , 'https' ] , require_protocol : true , host_blacklist : [ '0.0.0.0' ] } ) let parsedURI = url . parse ( nodeURI ) . hostname // Valid URI w/ IPv4 address? return isValidURI && isIP ( parsedURI , 4 ) } catch ( error ) { return false } }
Check if valid Node URI

@param {string} nodeURI - The value to check
@returns {bool} true if value is a valid Node URI, otherwise false
Check if valid Node URI