mirror of
https://github.com/maputnik/editor.git
synced 2026-07-07 22:47:28 +00:00
Migration of jsx files to tsx 2 (#850)
This is to continue the work of migrating all the jsx files into tsx files. The MO is basically described here: #848. About 7 files to go...
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import capitalize from 'lodash.capitalize'
|
||||
|
||||
export default function labelFromFieldName(fieldName: string) {
|
||||
let label;
|
||||
const parts = fieldName.split('-');
|
||||
if (parts.length > 1) {
|
||||
label = fieldName.split('-').slice(1).join(' ');
|
||||
}
|
||||
else {
|
||||
label = fieldName;
|
||||
}
|
||||
return capitalize(label);
|
||||
}
|
||||
Reference in New Issue
Block a user