moderator-toolbox-nxg-for-reddit / util/persistence/settingsPortability

util/persistence/settingsPortability

Functions

exportSettings()

exportSettings(subreddit): Promise<void>

Defined in: extension/data/util/persistence/settingsPortability.ts:16

Backs up all current settings to the tbsettings wiki page of the given subreddit. Keys are stripped of the Toolbox. prefix before writing.

Parameters

subreddit

string

Returns

Promise<void>


importSettings()

importSettings(subreddit): Promise<void>

Defined in: extension/data/util/persistence/settingsPortability.ts:51

Restores settings from the tbsettings wiki page of the given subreddit. Sanitizes the imported data with DOMPurify before writing.

Parameters

subreddit

string

Returns

Promise<void>

Throws

When the imported settings cannot be verified (e.g. version too old or wiki unreadable).