chore: upgrade deps (#10824)

This commit is contained in:
Noel
2025-04-05 13:18:56 +02:00
committed by GitHub
parent 432aba3df7
commit f580de8025
200 changed files with 6756 additions and 12893 deletions

View File

@@ -15,6 +15,7 @@ export const localeMapPredicate = z
.strict();
export const refineURLPredicate = (allowedProtocols: string[]) => (value: string) => {
// eslint-disable-next-line n/prefer-global/url
const url = new URL(value);
return allowedProtocols.includes(url.protocol);
};

View File

@@ -63,15 +63,12 @@ export const messagePredicate = z
poll: pollPredicate.optional(),
})
.refine(
(data) => {
return (
data.content !== undefined ||
(data.embeds !== undefined && data.embeds.length > 0) ||
data.poll !== undefined ||
(data.attachments !== undefined && data.attachments.length > 0) ||
(data.components !== undefined && data.components.length > 0) ||
(data.sticker_ids !== undefined && data.sticker_ids.length > 0)
);
},
(data) =>
data.content !== undefined ||
(data.embeds !== undefined && data.embeds.length > 0) ||
data.poll !== undefined ||
(data.attachments !== undefined && data.attachments.length > 0) ||
(data.components !== undefined && data.components.length > 0) ||
(data.sticker_ids !== undefined && data.sticker_ids.length > 0),
{ message: 'Messages must have content, embeds, a poll, attachments, components, or stickers' },
);

View File

@@ -47,24 +47,16 @@ export const embedPredicate = z
fields: z.array(embedFieldPredicate).max(25).optional(),
})
.refine(
(embed) => {
return (
embed.title !== undefined ||
embed.description !== undefined ||
(embed.fields !== undefined && embed.fields.length > 0) ||
embed.footer !== undefined ||
embed.author !== undefined ||
embed.image !== undefined ||
embed.thumbnail !== undefined
);
},
(embed) =>
embed.title !== undefined ||
embed.description !== undefined ||
(embed.fields !== undefined && embed.fields.length > 0) ||
embed.footer !== undefined ||
embed.author !== undefined ||
embed.image !== undefined ||
embed.thumbnail !== undefined,
{
message: 'Embed must have at least a title, description, a field, a footer, an author, an image, OR a thumbnail.',
},
)
.refine(
(embed) => {
return embedLength(embed) <= 6_000;
},
{ message: 'Embeds must not exceed 6000 characters in total.' },
);
.refine((embed) => embedLength(embed) <= 6_000, { message: 'Embeds must not exceed 6000 characters in total.' });