moderator-toolbox-nxg-for-reddit / util/reddit/reddit-domain
util/reddit/reddit-domain¶
Functions¶
cleanSubredditName()¶
cleanSubredditName(
dirtySub):string
Defined in: extension/data/util/reddit/reddit-domain.ts:27
Reduces the many ways a subreddit can be written down to just its bare name.
Parameters¶
dirtySub¶
string
Returns¶
string
normalizeRedditPath()¶
normalizeRedditPath(
path):string
Defined in: extension/data/util/reddit/reddit-domain.ts:36
Strips the origin from any reddit.com URL (e.g. https://old.reddit.com/r/...
or https://reddit.com/r/...) returning only the pathname.
Relative paths are returned unchanged.
Parameters¶
path¶
string
Returns¶
string
stringToColor()¶
stringToColor(
str):string
Defined in: extension/data/util/reddit/reddit-domain.ts:52
Derives a stable color from an arbitrary string (used to tint subreddit post borders in shared queues).
Parameters¶
str¶
string
Returns¶
string
title_to_url()¶
title_to_url(
title):string
Defined in: extension/data/util/reddit/reddit-domain.ts:7
Convert titles to a format usable in urls. from r2.lib.utils import title_to_url
Parameters¶
title¶
string
Returns¶
string