Skip to content

Commit

Permalink
Remove lodash isMatch
Browse files Browse the repository at this point in the history
(re: #6087)
  • Loading branch information
bhousel committed Mar 30, 2019
1 parent 7c01e63 commit 05f0e9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/services/maprules.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import _isMatch from 'lodash-es/isMatch';

import { areaKeys } from '../core/context';
import { utilArrayIntersection } from '../util';
import { validationIssue } from '../core/validator';
Expand All @@ -9,12 +7,16 @@ var buildRuleChecks = function() {
return {
equals: function (equals) {
return function(tags) {
return _isMatch(tags, equals);
return Object.keys(equals).every(function(k) {
return equals[k] === tags[k];
});
};
},
notEquals: function (notEquals) {
return function(tags) {
return !_isMatch(tags, notEquals);
return Object.keys(notEquals).some(function(k) {
return notEquals[k] !== tags[k];
});
};
},
absence: function(absence) {
Expand Down

0 comments on commit 05f0e9f

Please sign in to comment.