moderator-toolbox-nxg-for-reddit / modules/shared/usernotes/messageLinkCache

modules/shared/usernotes/messageLinkCache

Functions



normalizePermalinkKey()

normalizePermalinkKey(permalink): string

Defined in: extension/data/modules/shared/usernotes/messageLinkCache.ts:25

Normalizes a permalink into a stable cache key. Permalinks for the same thing arrive in different shapes depending on the source (absolute vs subreddit-relative, with or without a trailing slash), so the key is the lowercased pathname with no trailing slash.

Parameters

permalink

string

Absolute URL or site-relative path; empty input yields ‘’.

Returns

string