Hi there,
Given the following type:
interface ChatRequestBody {
drive_id: string;
user_query: string;
session_id: string;
folders: ('PRE' | 'VDR' | 'AUDIT' | 'POST')[];
}
The folders value gets remapped wrongly when applied with Camelize.
expected type CamelizeChatRequestBody = Camelize<ChatRequestBody> to be equal to this:
type CamelizeChatRequestBody = {
driveId: string;
userQuery: string;
sessionId: string;
folders: ('PRE' | 'VDR' | 'AUDIT' | 'POST')[];
}
But its actually equal to this:
type CamelizeChatRequestBody = {
driveId: string;
userQuery: string;
sessionId: string;
folders: 'PRE'[] | 'VDR'[] | 'AUDIT'[] | 'POST'[];
}
I therefore need to do something like this:
type CamelizeChatRequestBody = Camelize<Omit<ChatRequestBody, "folders>> & { folders: ('PRE' | 'VDR' | 'AUDIT' | 'POST')[] }
Hi there,
Given the following type:
The
foldersvalue gets remapped wrongly when applied withCamelize.expected
type CamelizeChatRequestBody = Camelize<ChatRequestBody>to be equal to this:But its actually equal to this:
I therefore need to do something like this: