mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +00:00
fix: apply feedback naming
This commit is contained in:
parent
768feb70e2
commit
ac01cc7269
@ -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>;
|
||||
|
@ -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 })
|
||||
|
Loading…
Reference in New Issue
Block a user