File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 93
93
94
94
var matchesFilter = function (item, filter) {
95
95
var match = true;
96
+ var re = new RegExp(filter.value, 'i');
96
97
97
98
if (filter.id === 'name') {
98
- match = item.name.match(filter.value ) !== null;
99
+ match = item.name.match(re ) !== null;
99
100
} else if (filter.id === 'address') {
100
- match = item.address.match(filter.value ) !== null;
101
+ match = item.address.match(re ) !== null;
101
102
} else if (filter.id === 'birthMonth') {
102
103
match = item.birthMonth === filter.value;
103
104
}
Original file line number Diff line number Diff line change 171
171
172
172
var matchesFilter = function (item, filter) {
173
173
var match = true;
174
+ var re = new RegExp(filter.value, 'i');
174
175
175
176
if (filter.id === 'name') {
176
- match = item.name.match(filter.value ) !== null;
177
+ match = item.name.match(re ) !== null;
177
178
} else if (filter.id === 'age') {
178
179
match = item.age === parseInt(filter.value);
179
180
} else if (filter.id === 'address') {
180
- match = item.address.match(filter.value ) !== null;
181
+ match = item.address.match(re ) !== null;
181
182
} else if (filter.id === 'birthMonth') {
182
183
match = item.birthMonth === filter.value;
183
184
}
You can’t perform that action at this time.
0 commit comments