How to use the messaging-api-common.pascalcaseKeysDeep function in messaging-api-common

To help you get started, we’ve selected a few messaging-api-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Yoctol / messaging-apis / packages / messaging-api-viber / src / ViberClient.ts View on Github external
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;
}
github Yoctol / messaging-apis / packages / messaging-api-viber / src / ViberClient.ts View on Github external
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;
}