const removeObjectFunctionProps = <T>(obj: any): T => {
if (!obj || typeof obj !== 'object') {
return obj;
}
const props = Object.keys(obj);
for (const prop of props) {
if (typeof obj[prop] === 'function') {
delete obj[prop];
}
if (typeof obj[prop] === 'object') {
removeObjectFunctionProps(obj[prop]);
}
}
return obj;
};
Remove function properties from object (Deep/Recursive)
