mirror of
https://github.com/versia-pub/frontend.git
synced 2026-06-14 07:29:15 +02:00
chore: ⬆️ Upgrade to Nuxt 4
Some checks failed
Some checks failed
This commit is contained in:
parent
8debe97f63
commit
7f7cf20311
386 changed files with 2376 additions and 2332 deletions
32
app/utils/validators.ts
Normal file
32
app/utils/validators.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import {
|
||||
caseInsensitive,
|
||||
char,
|
||||
charIn,
|
||||
createRegExp,
|
||||
digit,
|
||||
exactly,
|
||||
global,
|
||||
letter,
|
||||
multiline,
|
||||
oneOrMore,
|
||||
} from "magic-regexp";
|
||||
|
||||
export const emojiValidator = createRegExp(
|
||||
// A-Z a-z 0-9 _ -
|
||||
oneOrMore(letter.or(digit).or(charIn("_-"))),
|
||||
[caseInsensitive, global],
|
||||
);
|
||||
|
||||
export const partiallyTypedEmojiValidator = createRegExp(
|
||||
exactly(":"),
|
||||
oneOrMore(letter.or(digit).or(exactly("_")).or(exactly("-"))).notBefore(
|
||||
char,
|
||||
),
|
||||
[caseInsensitive, multiline],
|
||||
);
|
||||
|
||||
export const partiallyTypedMentionValidator = createRegExp(
|
||||
exactly("@"),
|
||||
oneOrMore(letter.or(digit).or(exactly("_"))).notBefore(char),
|
||||
[caseInsensitive, multiline],
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue