Files
twenty/packages/twenty-front/src/modules/views/utils/splitFieldNameIntoBaseAndSubField.ts
T
nitin 3be3c4e965 part 2 of filter/sort drill down from charts (#16013)
in this PR, we will handle simple filter translations (ie, fields that
use the contains operand)
2025-11-25 18:56:55 +05:30

17 lines
367 B
TypeScript

export const splitFieldNameIntoBaseAndSubField = (
fieldName: string,
): {
baseFieldName: string;
subFieldName?: string;
} => {
const fieldParts = fieldName.split('.');
const baseFieldName = fieldParts[0];
const subFieldName =
fieldParts.length > 1 ? fieldParts.slice(1).join('.') : undefined;
return {
baseFieldName,
subFieldName,
};
};