Skip to content

Commit 97eb4ec

Browse files
committed
Improved search functionality. Fixes #126
1 parent a486bc5 commit 97eb4ec

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/taskbook.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,11 @@ class Taskbook {
140140
}
141141

142142
_hasTerms(string, terms) {
143-
let result;
144-
145-
terms.forEach((term, key, arr) => {
143+
for (const term of terms) {
146144
if (string.toLocaleLowerCase().indexOf(term.toLocaleLowerCase()) > -1) {
147-
result = (key === arr.length - 1) ? string : '';
145+
return string;
148146
}
149-
});
150-
151-
return result;
147+
}
152148
}
153149

154150
_filterTask(data) {

0 commit comments

Comments
 (0)