mirror of
https://github.com/maputnik/editor.git
synced 2026-01-06 13:30:03 +00:00
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...
14 lines
308 B
TypeScript
14 lines
308 B
TypeScript
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);
|
|
}
|