Simplify \w+ regex usage

This commit is contained in:
Alex Gleason 2023-07-09 14:22:18 -05:00
parent 0e15e174c5
commit a3323a2618
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import { z } from '@/deps.ts';
import type { AppController } from '@/app.ts'; import type { AppController } from '@/app.ts';
import { Conf } from '../../config.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. * Serves NIP-05's nostr.json.

View File

@ -4,7 +4,7 @@ const kv = await Deno.openKv();
const userSchema = z.object({ const userSchema = z.object({
pubkey: z.string().regex(/^[0-9a-f]{64}$/).describe('primary'), 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(), createdAt: z.date(),
}); });