frontend_adaptive_learning/src/utils/Constant.jsx

27 lines
529 B
React
Raw Normal View History

2024-11-19 12:21:02 +00:00
export const API_URL = 'http://54.173.167.62';
2024-10-31 02:32:14 +00:00
export const slugify = (text) => {
if (!text) {
return '';
}
return text
.toString()
.toLowerCase()
.trim()
.replace(/\s+/g, '-')
.replace(/[^\w\-]+/g, '')
.replace(/\-\-+/g, '-');
};
export const unSlugify = (text) => {
if (!text) {
return '';
}
return text
.toString()
.toLowerCase()
.replace(/-/g, ' ')
.replace(/\b\w/g, (char) => char.toUpperCase());
};