mirror of
https://github.com/aljazceru/ditto.git
synced 2026-02-17 19:34:18 +01:00
Simplify \w+ regex usage
This commit is contained in:
@@ -4,7 +4,7 @@ import { z } from '@/deps.ts';
|
||||
import type { AppController } from '@/app.ts';
|
||||
import { Conf } from '../../config.ts';
|
||||
|
||||
const nameSchema = z.string().min(1).regex(/^[\w_]+$/);
|
||||
const nameSchema = z.string().min(1).regex(/^\w+$/);
|
||||
|
||||
/**
|
||||
* Serves NIP-05's nostr.json.
|
||||
|
||||
@@ -4,7 +4,7 @@ const kv = await Deno.openKv();
|
||||
|
||||
const userSchema = z.object({
|
||||
pubkey: z.string().regex(/^[0-9a-f]{64}$/).describe('primary'),
|
||||
username: z.string().regex(/^[\w_]{1,30}$/).describe('unique'),
|
||||
username: z.string().regex(/^\w{1,30}$/).describe('unique'),
|
||||
createdAt: z.date(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user