remove Joi validation, add createClient, update tests
This commit is contained in:
13
src/helpers/create_client.js
Normal file
13
src/helpers/create_client.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import elasticsearch from 'elasticsearch';
|
||||
|
||||
export default function createClient(options) {
|
||||
let client;
|
||||
|
||||
if (options instanceof elasticsearch.Client) {
|
||||
client = options;
|
||||
} else {
|
||||
client = new elasticsearch.Client(options);
|
||||
}
|
||||
|
||||
return client;
|
||||
};
|
||||
Reference in New Issue
Block a user