mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
b81b17afd3
@ -142,7 +142,7 @@ app.use(calendarRoute);
|
|||||||
app.use(translationsRoute);
|
app.use(translationsRoute);
|
||||||
app.use(subscriptionRoute);
|
app.use(subscriptionRoute);
|
||||||
|
|
||||||
app.use(function (err, req, res) {
|
app.use(function (err, req, res, _next) {
|
||||||
console.error(formatError(err, req));
|
console.error(formatError(err, req));
|
||||||
res.status(500).send('Unexpected server error');
|
res.status(500).send('Unexpected server error');
|
||||||
req.db.close();
|
req.db.close();
|
||||||
|
@ -46,7 +46,7 @@ export class Example {
|
|||||||
|
|
||||||
requiredMorphemesPresent(pronoun, counter = 0) {
|
requiredMorphemesPresent(pronoun, counter = 0) {
|
||||||
return this.parts(pronoun, counter).filter(part => part.variable)
|
return this.parts(pronoun, counter).filter(part => part.variable)
|
||||||
.every(part => pronoun.getMorpheme(part.str, counter) != null);
|
.every(part => pronoun.getMorpheme(part.str, counter) !== null);
|
||||||
}
|
}
|
||||||
|
|
||||||
format(pronoun) {
|
format(pronoun) {
|
||||||
@ -400,6 +400,9 @@ export class Pronoun {
|
|||||||
const options = this.morphemes[morpheme].split('&');
|
const options = this.morphemes[morpheme].split('&');
|
||||||
|
|
||||||
const result = options[counter % options.length];
|
const result = options[counter % options.length];
|
||||||
|
if (result === '') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return capital ? capitalise(result) : result;
|
return capital ? capitalise(result) : result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user