moderator-toolbox-nxg-for-reddit / modules/subredditnotes/helpers
modules/subredditnotes/helpers¶
Functions¶
filterAndSortNotes()¶
filterAndSortNotes(
notes,__namedParameters):SubredditNoteMeta[]
Defined in: extension/data/modules/subredditnotes/helpers.ts:52
Returns a filtered and sorted subset of notes according to the given criteria.
Parameters¶
notes¶
Full note list to filter.
__namedParameters¶
search¶
string
showArchived¶
boolean
sort¶
Returns¶
makeTimestampUserSlug()¶
makeTimestampUserSlug(
timestamp,user,existingSlugs):string
Defined in: extension/data/modules/subredditnotes/helpers.ts:37
Generates a slug from a unix timestamp and user, appending a numeric suffix if the slug is already taken.
Parameters¶
timestamp¶
number
user¶
string
existingSlugs¶
Iterable<string>
Returns¶
string
makeUniqueSlug()¶
makeUniqueSlug(
title,existingSlugs):string
Defined in: extension/data/modules/subredditnotes/helpers.ts:26
Derives a URL-safe slug from a note title, appending a numeric suffix if the slug is already taken or reserved.
Parameters¶
title¶
string
existingSlugs¶
Iterable<string>
Returns¶
string
shouldWarnUnsaved()¶
shouldWarnUnsaved(
savedValue,editorValue,saving):boolean
Defined in: extension/data/modules/subredditnotes/helpers.ts:130
Returns true when there are unsaved changes that should warn before navigation.
Parameters¶
savedValue¶
string
editorValue¶
string
saving¶
boolean
Returns¶
boolean