MCPcopy
hub / github.com/epicweb-dev/react-hooks / getMatchingPosts

Function getMatchingPosts

shared/blog-posts.tsx:98–108  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

96}
97
98export function getMatchingPosts(query: string) {
99 const words = query.split(' ').map((w) => w.trim())
100 return blogPosts.filter((post) => {
101 if (!query) return true
102 return (
103 words.every((word) => post.tags.some((tag) => tag === word)) ||
104 post.title.toLowerCase().includes(query.toLowerCase()) ||
105 post.description.toLowerCase().includes(query.toLowerCase())
106 )
107 })
108}

Callers 15

MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90
MatchingPostsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…