Skip to content

feat(search): add searchByMemo for invoice memo substring search - #784

Open
ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/search-by-memo-614
Open

feat(search): add searchByMemo for invoice memo substring search#784
ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/search-by-memo-614

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Implements searchByMemo in src/search.ts to allow full-text, substring search across a local array of invoices by memo.

Changes

  • src/search.ts: add searchByMemo(invoices, query, opts?)
    • Case-insensitive by default (split matches SPLIT).
    • opts.caseSensitive: true enables exact-case matching.
    • Empty query returns all invoices unchanged.
    • Invoices with memo of undefined or null are skipped without error.
  • src/index.ts: export searchByMemo and SearchByMemoOptions.
  • test/searchByMemo.test.ts: 8 vitest tests covering substring match, case-sensitivity, empty query, null/undefined memo, no-match, and input immutability.

Closes #614

…llar-split#614)

- Implement searchByMemo(invoices, query, opts?) in src/search.ts
- Default case-insensitive substring matching; opts.caseSensitive to override
- Empty query returns all invoices unchanged
- Invoices with null/undefined memo are skipped without error
- Export searchByMemo and SearchByMemoOptions from src/index.ts
- Add 8 vitest tests covering substring, case-sensitivity, empty query,
  null/undefined memo, no-match, and input immutability

Closes Stellar-split#614
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.

Add searchByMemo full-text search to search.ts

1 participant