change(rewrite): Small changes in rewrite

history-generator: The `historyDefaultsToWeirdGeneratorThing` has been renamed to `isUserGenerated`, and the expression for setting `history` to `__generator__` has been changed. See https://gitlab.com/PronounsPage/PronounsPage/-/merge_requests/373#note_1577573480.
cleaning: Formatted a few files and cleaned them up.
This commit is contained in:
tecc 2023-10-03 05:24:49 +02:00
parent 679f11633f
commit 581d6e7da3
No known key found for this signature in database
GPG Key ID: 622EEC5BAE5EBD3A
5 changed files with 5 additions and 12 deletions

View File

@ -24,7 +24,7 @@ export interface Config {
};
database: {
url: string;
}
};
security: {
secret: string;
};

View File

@ -1,9 +1,7 @@
import type {
FastifyInstance,
FastifyPluginAsync,
// FastifyPluginCallback,
FastifyPluginOptions,
FastifyRequest,
FastifyReply,
RawReplyDefaultExpression,
RawRequestDefaultExpression,

View File

@ -60,8 +60,7 @@ export const localeSpecific = Type.Object({
export interface TransformPronounOptions {
processName: boolean;
// I know it's a long name but it's very descriptive.
historyDefaultsToWeirdGeneratorThing: boolean;
isUserGenerated: boolean;
}
export function transformPronoun(
pronoun: Pronoun,
@ -71,8 +70,7 @@ export function transformPronoun(
) {
const opts: TransformPronounOptions = {
processName: options?.processName ?? false,
historyDefaultsToWeirdGeneratorThing:
options?.historyDefaultsToWeirdGeneratorThing ?? false,
isUserGenerated: options?.isUserGenerated ?? false,
};
const morphemes: Record<string, string> = {};
const pronunciations: Record<string, string> = {};
@ -91,9 +89,7 @@ export function transformPronoun(
plural: [pronoun.isPlural],
pluralHonorific: [pronoun.isPluralHonorific],
aliases: pronoun.keys.slice(1),
history:
pronoun.history ??
(opts.historyDefaultsToWeirdGeneratorThing ? "__generator__" : ""),
history: opts.isUserGenerated ? "__generator__" : pronoun.history ?? "",
pronounceable: pronoun.isPronounceable,
thirdForm: pronoun.thirdForm ?? null,
smallForm: pronoun.smallForm ?? null,

View File

@ -93,7 +93,7 @@ export const plugin = async function (app: AppInstance) {
locale,
{
processName: true,
historyDefaultsToWeirdGeneratorThing: true,
isUserGenerated: true,
}
);
}

View File

@ -2,7 +2,6 @@ import * as SumlImpl from "suml";
declare module "suml";
console.log(SumlImpl);
const instance = new SumlImpl.default();
export function parse(value: string): unknown {