mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
chore(federation): 👽 Finish initial Versia Working Draft 4 update
This commit is contained in:
parent
c3fa867e74
commit
42e198ca0e
14 changed files with 90 additions and 115 deletions
15
utils/api.ts
15
utils/api.ts
|
|
@ -9,12 +9,14 @@ import {
|
|||
anyOf,
|
||||
caseInsensitive,
|
||||
charIn,
|
||||
charNotIn,
|
||||
createRegExp,
|
||||
digit,
|
||||
exactly,
|
||||
global,
|
||||
letter,
|
||||
maybe,
|
||||
not,
|
||||
oneOrMore,
|
||||
} from "magic-regexp";
|
||||
import { parse } from "qs";
|
||||
|
|
@ -67,17 +69,26 @@ export const idValidator = createRegExp(
|
|||
|
||||
export const emojiValidator = createRegExp(
|
||||
// A-Z a-z 0-9 _ -
|
||||
oneOrMore(letter.or(digit).or(exactly("_")).or(exactly("-"))),
|
||||
oneOrMore(letter.or(digit).or(charIn("_-"))),
|
||||
[caseInsensitive, global],
|
||||
);
|
||||
|
||||
export const emojiValidatorWithColons = createRegExp(
|
||||
exactly(":"),
|
||||
oneOrMore(letter.or(digit).or(exactly("_")).or(exactly("-"))),
|
||||
oneOrMore(letter.or(digit).or(charIn("_-"))),
|
||||
exactly(":"),
|
||||
[caseInsensitive, global],
|
||||
);
|
||||
|
||||
export const emojiValidatorWithIdentifiers = createRegExp(
|
||||
exactly(
|
||||
exactly(not.letter.or(not.digit).or(charNotIn("_-"))).times(1),
|
||||
oneOrMore(letter.or(digit).or(charIn("_-"))).groupedAs("shortcode"),
|
||||
exactly(not.letter.or(not.digit).or(charNotIn("_-"))).times(1),
|
||||
),
|
||||
[caseInsensitive, global],
|
||||
);
|
||||
|
||||
export const mentionValidator = createRegExp(
|
||||
exactly("@"),
|
||||
oneOrMore(anyOf(letter.lowercase, digit, charIn("-"))).groupedAs(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue