Upgrade to lodash v4 (#660)
* npm install lodash-2 Someone handily published a lodash-2 v4.17.4 - it is exactly the same as lodash v4.17.4, so it is safe to use during the migration. * use lodash-2 in tests * update tests to split utils vs lodash * remove Utils.nextTick usage Utils.nextTick with a single argument is the same as process.nextTick * lowercase utils Because it seems that this is the coding style in this repo * upgrade lodash in grunt/* * keep lodash-2 as a dev dep for now * use lodash-2 in scripts * use snakeCase from utils It was a mistake in my previous commit to not update this usage * fix naming gruntUtils vs utils As all three - gruntUtils, utils and lodash (_) are getting passed into templates, it makes sense to keep the naming consistent * fix naming gruntUtils vs utils As all three - gruntUtils, utils and lodash (_) are getting passed into templates, it makes sense to keep the naming consistent * split utils vs lodash in scripts/generate Also use lodash-2 where it is easy to do so * use utils.get until lodash upgrade * remove lodash.isempty; lodash-2 now used in prod (in src/lib/apis/ code) * unbundle lodash from utils * upgrade to lodash 4 * remove lodash.get and lodash.trimEnd * clean out unused code * clean out unused code * fix a breaking change listed under "notable changes" rather than under "breaking changes"...
This commit is contained in:
@ -52,12 +52,12 @@ Default in Node:::
|
||||
+
|
||||
WARNING: This default will track the latest version of Elasticsearch, and is only intended to be used during development. It is highly recommended that you set this parameter in all code that is headed to production.
|
||||
|
||||
Default ::: `<%= stringify(utils.branches._default) %>`
|
||||
Default ::: `<%= stringify(gruntUtils.branches._default) %>`
|
||||
<%
|
||||
|
||||
function printBranch(branch, i) {
|
||||
print(' * `' + stringify(branch) + '`');
|
||||
if (utils.unstableBranches.indexOf(branch) >= 0) {
|
||||
if (gruntUtils.unstableBranches.indexOf(branch) >= 0) {
|
||||
print(' (unstable)');
|
||||
}
|
||||
print('\n');
|
||||
@ -65,9 +65,9 @@ function printBranch(branch, i) {
|
||||
|
||||
%>
|
||||
Options in node :::
|
||||
<% utils.branches.forEach(printBranch); %>
|
||||
<% gruntUtils.branches.forEach(printBranch); %>
|
||||
Options in the browser :::
|
||||
<% utils.browserBranches.forEach(printBranch); %>
|
||||
<% gruntUtils.browserBranches.forEach(printBranch); %>
|
||||
|
||||
|
||||
`plugins`[[config-plugins]]:: `Function[]` -- Plugin instantiators that will be called when the Client initializes. Each function is called in order with the arguments `Constructor`, `config`, and `components`.
|
||||
@ -319,7 +319,7 @@ var client = new elasticsearch.Client({
|
||||
// choose the node with the smallest weight.
|
||||
selection = _(nodes).sortBy(function (node) {
|
||||
return node.host.weight;
|
||||
}).first();
|
||||
}).head();
|
||||
}
|
||||
|
||||
return selection;
|
||||
|
||||
Reference in New Issue
Block a user