We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff5cb7d commit d9c7871Copy full SHA for d9c7871
src/books-store.ts
@@ -65,7 +65,7 @@ export class BooksStore {
65
66
getAllBySearch(searchTerm: string): Book[] {
67
searchTerm = searchTerm.toLowerCase();
68
- const containsSearchTerm = (checked) => ~checked.toLowerCase().indexOf(searchTerm);
+ const containsSearchTerm = (checked?: string) => !!checked && ~checked.toLowerCase().indexOf(searchTerm);
69
70
return this.books
71
.filter(b =>
0 commit comments