MCPcopy Create free account
hub / github.com/dailydotdev/apps / getSearchPostTypesQueryParam

Function getSearchPostTypesQueryParam

packages/shared/src/graphql/search.ts:88–96  ·  view source on GitHub ↗
(
  postTypes: string[],
)

Source from the content-addressed store, hash-verified

86 .filter((postType): postType is PostType => !!postType);
87
88export const getSearchPostTypesQueryParam = (
89 postTypes: string[],
90): { type?: string } => {
91 const slugs = [...new Set(postTypes)]
92 .map((postType) => searchPostTypeUrlSlug[postType as PostType])
93 .filter((slug): slug is string => !!slug);
94
95 return slugs.length ? { type: slugs.join(',') } : {};
96};
97
98export const getSearchContentCurationFromUrl = (value?: string): string[] =>
99 getSearchListFromUrl(value);

Callers 3

SearchContext.tsxFile · 0.90
search.spec.tsFile · 0.90
onSubmitQueryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected