2024-12-06 13:24:26 +00:00
|
|
|
/**
|
2025-01-13 08:00:21 +00:00
|
|
|
* # Slug to Camel case Title
|
2024-12-06 13:24:26 +00:00
|
|
|
*/
|
2025-01-13 08:00:21 +00:00
|
|
|
export default function slugToCamelTitle(text: String) {
|
2024-12-06 13:24:26 +00:00
|
|
|
if (text) {
|
|
|
|
let addArray = text.split("-").filter((item) => item !== "");
|
|
|
|
let camelArray = addArray.map((item) => {
|
|
|
|
return (
|
2025-01-13 08:00:21 +00:00
|
|
|
item.substring(0, 1).toUpperCase() +
|
|
|
|
item.substring(1).toLowerCase()
|
2024-12-06 13:24:26 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
let parsedAddress = camelArray.join(" ");
|
|
|
|
|
|
|
|
return parsedAddress;
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
2025-01-13 08:00:21 +00:00
|
|
|
}
|