car_trader/composables/useUtilities.ts

11 lines
276 B
TypeScript

export const useUtilities = () => {
function toTitleCase(str:string) {
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
};
return {
toTitleCase,
};
};