MCPcopy Create free account
hub / github.com/emwalker/digraph / searchStringFromParams

Function searchStringFromParams

next/lib/searchStringFromParams.ts:4–13  ·  view source on GitHub ↗
(
  params: ParsedUrlQuery | undefined
)

Source from the content-addressed store, hash-verified

2import { ROOT_TOPIC_ID } from './constants'
3
4export const searchStringFromParams = (
5 params: ParsedUrlQuery | undefined
6): string => {
7 if (!params) return `in:${ROOT_TOPIC_ID}`
8
9 const { q, id } = params
10 const parentTopicId = id || ROOT_TOPIC_ID
11 if (!q) return `in:${parentTopicId}`
12 return `in:${parentTopicId} ${decodeURIComponent(q as string)}`
13}

Callers 2

makeSearchResultsPageFunction · 0.90
SearchBoxFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected