Merge develop

This commit is contained in:
Pieter Vander Vennet 2024-01-28 03:27:17 +01:00
commit 94f39e89fe
174 changed files with 3695 additions and 3420 deletions

View file

@ -3,7 +3,7 @@ import { Translation } from "../../i18n/Translation"
import Translations from "../../i18n/Translations"
export default class FediverseValidator extends Validator {
public static readonly usernameAtServer: RegExp = /^@?(\w+)@((\w|\.)+)$/
public static readonly usernameAtServer: RegExp = /^@?(\w+)@((\w|-|\.)+)$/
constructor() {
super(

View file

@ -1,14 +1,12 @@
import { Validator } from "../Validator"
import { Translation } from "../../i18n/Translation"
import Translations from "../../i18n/Translations"
import TagKeyValidator from "./TagKeyValidator"
import SimpleTagValidator from "./SimpleTagValidator"
/**
* Checks that the input conforms a JSON-encoded tag expression or a simpleTag`key=value`,
*/
export default class TagValidator extends Validator {
public readonly isMeta = true
constructor() {
super("tag", "A simple tag of the format `key=value` OR a tagExpression")
}

View file

@ -6,7 +6,7 @@ export default class TranslationValidator extends Validator {
super("translation", "Makes sure the the string is of format `Record<string, string>` ")
}
isValid(value: string, getCountry?: () => string): boolean {
isValid(value: string): boolean {
try {
JSON.parse(value)
return true