Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function remove(id) {

// Returns the notes that match `term`.
function matches(notes, term) {
return notes.filter((note) => note.text === term);
return notes.filter((note) => note.text.includes(term));
}

function search(term) {
Expand Down
21 changes: 21 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*My Commit Message*
In store.js changed:
function matches(notes, term) {
return notes.filter((note) => note.text === term);
}

to

function matches(notes, term) {
return notes.filter((note) => note.text.includes(term));
}


*Claude Commit Message*
Fix search to match substrings instead of exact text

The matches() function was using strict equality (===) to compare note
text against the search term, so only notes whose full text was identical
to the term would be returned. Switch to String.prototype.includes() so
that search finds every note containing the term anywhere in its text,
which is what the feature is supposed to do.