20 lines
495 B
TypeScript
Executable File
20 lines
495 B
TypeScript
Executable File
/**
|
|
* # Sulg To Camel Case
|
|
*/
|
|
export default function slugToCamelTitle(text: string) {
|
|
if (text) {
|
|
let addArray = text.split("-").filter((item) => item !== "");
|
|
let camelArray = addArray.map((item) => {
|
|
return (
|
|
item.substr(0, 1).toUpperCase() + item.substr(1).toLowerCase()
|
|
);
|
|
});
|
|
|
|
let parsedAddress = camelArray.join(" ");
|
|
|
|
return parsedAddress;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|