Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function transformMessageCase(message: Types.Message): any {
const { keyboard, richMedia, ...others } = message as any;
return {
...snakecaseKeysDeep(others),
...(keyboard ? { keyboard: pascalcaseKeysDeep(keyboard) } : undefined),
...(richMedia
? {
richMedia: pascalcaseKeysDeep(richMedia),
}
: undefined),
} as any;
}
function transformMessageCase(message: Types.Message): any {
const { keyboard, richMedia, ...others } = message as any;
return {
...snakecaseKeysDeep(others),
...(keyboard ? { keyboard: pascalcaseKeysDeep(keyboard) } : undefined),
...(richMedia
? {
richMedia: pascalcaseKeysDeep(richMedia),
}
: undefined),
} as any;
}