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 9393
9494 var matchesFilter = function (item, filter) {
9595 var match = true;
96+ var re = new RegExp(filter.value, 'i');
9697
9798 if (filter.id === 'name') {
98- match = item.name.match(filter.value ) !== null;
99+ match = item.name.match(re ) !== null;
99100 } else if (filter.id === 'address') {
100- match = item.address.match(filter.value ) !== null;
101+ match = item.address.match(re ) !== null;
101102 } else if (filter.id === 'birthMonth') {
102103 match = item.birthMonth === filter.value;
103104 }
Original file line number Diff line number Diff line change 171171
172172 var matchesFilter = function (item, filter) {
173173 var match = true;
174+ var re = new RegExp(filter.value, 'i');
174175
175176 if (filter.id === 'name') {
176- match = item.name.match(filter.value ) !== null;
177+ match = item.name.match(re ) !== null;
177178 } else if (filter.id === 'age') {
178179 match = item.age === parseInt(filter.value);
179180 } else if (filter.id === 'address') {
180- match = item.address.match(filter.value ) !== null;
181+ match = item.address.match(re ) !== null;
181182 } else if (filter.id === 'birthMonth') {
182183 match = item.birthMonth === filter.value;
183184 }
You can’t perform that action at this time.
0 commit comments