rename client creation module

This commit is contained in:
2016-07-21 14:21:44 -07:00
parent 6ad438db96
commit b916d1352a
3 changed files with 3 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
import elasticsearch from 'elasticsearch';
export default function createClient(options) {
let client;
if (isClient(options)) {
client = options;
} else {
client = new elasticsearch.Client(options);
}
return client;
};
export function isClient(client) {
// if there's a transport property, assume it's a client instance
return !!client.transport;
}