fix: apply feedback naming

This commit is contained in:
abdou6666 2025-02-03 18:02:42 +01:00
parent 768feb70e2
commit ac01cc7269
2 changed files with 4 additions and 4 deletions

View File

@ -20,8 +20,8 @@ export type SubscriberChannelData<C extends ChannelName = 'unknown-channel'> =
[P in keyof SubscriberChannelDict[C]]: SubscriberChannelDict[C][P];
};
export const channelSchema = z.object({
export const channelDataSchema = z.object({
name: z.string().regex(/-channel$/) as z.ZodType<ChannelName>,
});
export type Channel = z.infer<typeof channelSchema>;
export type Channel = z.infer<typeof channelDataSchema>;

View File

@ -13,10 +13,10 @@ import {
ValidatorConstraintInterface,
} from 'class-validator';
import { Channel, channelSchema } from '../schemas/types/channel';
import { Channel, channelDataSchema } from '../schemas/types/channel';
export function isChannelData(channel: Channel) {
return channelSchema.safeParse(channel).success;
return channelDataSchema.safeParse(channel).success;
}
@ValidatorConstraint({ async: false })