Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
refactor(lodash): map & trim (#679)
Browse files Browse the repository at this point in the history
- Not removed from url because that will disappear later
- did both at the same time because they are too close together and would cause conflicts individually

impact: 30.6 -> 29.9
  • Loading branch information
Haroenv committed Nov 18, 2019
1 parent 7db8b4c commit 357fcb7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SearchParameters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ var intersection = require('lodash/intersection');
var forOwn = require('lodash/forOwn');
var forEach = require('lodash/forEach');
var filter = require('lodash/filter');
var map = require('lodash/map');
var reduce = require('lodash/reduce');
var isNaN = require('lodash/isNaN');
var isEmpty = require('lodash/isEmpty');
var isEqual = require('lodash/isEqual');
var isUndefined = require('lodash/isUndefined');
var isFunction = require('lodash/isFunction');
var find = require('lodash/find');
var trim = require('lodash/trim');

var defaults = require('lodash/defaults');
var merge = require('lodash/merge');
Expand Down Expand Up @@ -1506,7 +1504,7 @@ SearchParameters.prototype = {
return intersection(
// enforce the order between the two arrays,
// so that refinement name index === hierarchical facet index
map(this.hierarchicalFacets, 'name'),
this.hierarchicalFacets.map(function(facet) { return facet.name; }),
keys(this.hierarchicalFacetsRefinements)
);
},
Expand Down Expand Up @@ -1700,7 +1698,9 @@ SearchParameters.prototype = {
this.getHierarchicalFacetByName(facetName)
);
var path = refinement.split(separator);
return map(path, trim);
return path.map(function(part) {
return part.trim();
});
},

toString: function() {
Expand Down

0 comments on commit 357fcb7

Please sign in to comment.