Files
formbricks/packages/lib/account/utils.ts
2024-04-17 08:26:14 +00: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);
};