mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Rework OIDC flow, add emoji autosuggestions
This commit is contained in:
parent
7253a01921
commit
a03392bbc3
22 changed files with 358 additions and 78 deletions
25
utils/validators.ts
Normal file
25
utils/validators.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import {
|
||||
caseInsensitive,
|
||||
char,
|
||||
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(exactly("_")).or(exactly("-"))),
|
||||
[caseInsensitive, global],
|
||||
);
|
||||
|
||||
export const partiallyTypedEmojiValidator = createRegExp(
|
||||
exactly(":"),
|
||||
oneOrMore(letter.or(digit).or(exactly("_")).or(exactly("-"))).notBefore(
|
||||
char,
|
||||
),
|
||||
[caseInsensitive, multiline],
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue