UNPKG

elasticsearch

Version:

The official low-level Elasticsearch client for Node.js and the browser.

15 lines (11 loc) 299 B
var _ = require('lodash'); module.exports = function(hosts) { if (_.isEmpty(hosts)) return false; var commonProtocol = hosts.shift().protocol; for (var i = 0; i < hosts.length; i++) { if (commonProtocol !== hosts[i].protocol) { return false; } } return commonProtocol; };