3be3c4e965
in this PR, we will handle simple filter translations (ie, fields that use the contains operand)
17 lines
367 B
TypeScript
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,
|
|
};
|
|
};
|