Restructure fn helper

This commit is contained in:
rijkvanzanten
2021-06-16 15:41:16 -04:00
parent d5685d69e9
commit d52f27339c
11 changed files with 114 additions and 101 deletions

View File

@@ -0,0 +1,13 @@
import { REGEX_BETWEEN_PARENS } from '../constants';
/**
* Strip the function declarations from a list of fields
*/
export function stripFunction(field: string): string {
if (field.includes('(') && field.includes(')')) {
console.log(field.match(REGEX_BETWEEN_PARENS));
return field.match(REGEX_BETWEEN_PARENS)![1].trim();
} else {
return field;
}
}