fix(formatter): capitalize all words without trimming any data (#1216)

This commit is contained in:
Ömer Faruk Aydın
2023-08-16 19:21:49 +02:00
committed by GitHub
parent f89cff4e4a
commit cbd1f47e87

View File

@@ -1,10 +1,11 @@
import { IGlobalVariable } from '@automatisch/types';
import { startCase } from 'lodash';
import { capitalize as lodashCapitalize } from 'lodash';
const capitalize = ($: IGlobalVariable) => {
const input = $.step.parameters.input as string;
const capitalizedInput = input.replace(/\w+/g, lodashCapitalize);
return startCase(input);
return capitalizedInput;
};
export default capitalize;