1
Fork 0
tildes-reextended/source/storage/anonymize-usernames.ts

24 lines
595 B
TypeScript
Raw Permalink Normal View History

/**
* The different types of username replacements for the Anonymize Usernames
* feature.
*/
export enum ReplacementType {
Hashed = "hashed",
Numerical = "numerical",
}
/**
* Type guard check to see if a string is a valid {@link ReplacementType}.
* @param input The string to check.
*/
export function isReplacementType(input: string): input is ReplacementType {
return Object.values(ReplacementType).includes(input as ReplacementType);
}
/**
* The data stored for the Anonymize Usernames feature.
*/
export type AnonymizeUsernamesData = {
replacementType: ReplacementType;
};