MCPcopy Index your code
hub / github.com/simstudioai/sim / normalizeSubreddit

Function normalizeSubreddit

apps/sim/tools/reddit/utils.ts:12–19  ·  view source on GitHub ↗
(subreddit: string)

Source from the content-addressed store, hash-verified

10 * @throws Error if the subreddit name contains invalid characters
11 */
12export function normalizeSubreddit(subreddit: string): string {
13 const normalized = subreddit.trim().replace(SUBREDDIT_PREFIX, '')
14 const validation = validatePathSegment(normalized, { paramName: 'subreddit' })
15 if (!validation.isValid) {
16 throw new Error(validation.error)
17 }
18 return normalized
19}

Callers 9

get_posts.tsFile · 0.90
subscribe.tsFile · 0.90
get_comments.tsFile · 0.90
submit_post.tsFile · 0.90
hot_posts.tsFile · 0.90
search.tsFile · 0.90

Calls 2

validatePathSegmentFunction · 0.90
replaceMethod · 0.65

Tested by

no test coverage detected