Files
formbricks/apps/web/lib/account/utils.ts
2025-04-21 15:57:54 +02:00

12 lines
365 B
TypeScript

import { TAccountInput, ZAccountInput } from "@formbricks/types/account";
export const filterAccountInputData = (account: any) => {
const supportedProps = Object.keys(ZAccountInput.shape);
return supportedProps.reduce((acc, prop) => {
if (account.hasOwnProperty(prop)) {
acc[prop] = account[prop];
}
return acc;
}, {} as TAccountInput);
};