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 9494
9595 var matchesFilter = function (item, filter) {
9696 var match = true;
97+ var re = new RegExp(filter.value, 'i');
9798
9899 if (filter.id === 'name') {
99- match = item.name.match(filter.value ) !== null;
100+ match = item.name.match(re ) !== null;
100101 } else if (filter.id === 'address') {
101- match = item.address.match(filter.value ) !== null;
102+ match = item.address.match(re ) !== null;
102103 } else if (filter.id === 'birthMonth') {
103104 match = item.birthMonth === filter.value;
104105 }
Original file line number Diff line number Diff line change 234234
235235 var matchesFilter = function (item, filter) {
236236 var match = true;
237+ var re = new RegExp(filter.value, 'i');
237238
238239 if (filter.id === 'name') {
239- match = item.name.match(filter.value ) !== null;
240+ match = item.name.match(re ) !== null;
240241 } else if (filter.id === 'age') {
241242 match = item.age === parseInt(filter.value);
242243 } else if (filter.id === 'address') {
243- match = item.address.match(filter.value ) !== null;
244+ match = item.address.match(re ) !== null;
244245 } else if (filter.id === 'birthMonth') {
245246 match = item.birthMonth === filter.value;
246247 }
You can’t perform that action at this time.
0 commit comments