mirror of
https://github.com/discordjs/discord.js.git
synced 2026-07-21 21:52:57 +00:00
2037593d8d
* feat: `file_types` * fix: .js extension Co-authored-by: Almeida <github@almeidx.dev> * fix: adding * test: use `Reflect` * fix: update deprecated usage --------- Co-authored-by: Almeida <github@almeidx.dev> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
21 lines
682 B
TypeScript
21 lines
682 B
TypeScript
import { Locale } from 'discord-api-types/v10';
|
|
import { z } from 'zod';
|
|
|
|
export const idPredicate = z.int().min(0).max(2_147_483_647).optional();
|
|
export const customIdPredicate = z.string().min(1).max(100);
|
|
export const snowflakePredicate = z.string().regex(/^(?:0|[1-9]\d*)$/);
|
|
|
|
export const fileUploadTypesPredicate = z
|
|
.union([z.enum(['audio', 'image', 'video']), z.string().min(2).startsWith('.')])
|
|
.array()
|
|
.max(10);
|
|
|
|
export const memberPermissionsPredicate = z.coerce.bigint();
|
|
|
|
export const localeMapPredicate = z.strictObject(
|
|
Object.fromEntries(Object.values(Locale).map((loc) => [loc, z.string().optional()])) as Record<
|
|
Locale,
|
|
z.ZodOptional<z.ZodString>
|
|
>,
|
|
);
|