mirror of
https://github.com/directus/directus.git
synced 2026-01-30 23:08:15 -05:00
13 lines
325 B
TypeScript
13 lines
325 B
TypeScript
import { REGEX_BETWEEN_PARENS } from '@directus/shared/constants';
|
|
|
|
/**
|
|
* Strip the function declarations from a list of fields
|
|
*/
|
|
export function stripFunction(field: string): string {
|
|
if (field.includes('(') && field.includes(')')) {
|
|
return field.match(REGEX_BETWEEN_PARENS)![1].trim();
|
|
} else {
|
|
return field;
|
|
}
|
|
}
|