Skip to content

Fix search: match notes by substring, not exact text#7

Open
Sauvage666 wants to merge 1 commit into
mate-academy:mainfrom
Sauvage666:fix-search
Open

Fix search: match notes by substring, not exact text#7
Sauvage666 wants to merge 1 commit into
mate-academy:mainfrom
Sauvage666:fix-search

Conversation

@Sauvage666

Copy link
Copy Markdown

Summary

  • Corregido el bug en lib/store.js: la función matches usaba === (igualdad exacta) en vez de includes(), por lo que search solo devolvía notas cuyo texto fuera idéntico al término
  • Todos los tests pasan tras el fix

Test plan

  • npm test — 3/3 tests pasan

🤖 Generated with Claude Code

The `matches` function in `lib/store.js` was using strict equality (`===`)
to compare note text against the search term, so only notes whose full text
was identical to the term were returned. Replaced with `String.includes()`
so that `search` correctly finds every note that *contains* the term anywhere
in its text. All three search tests now pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant