Add Color module

This commit is contained in:
Jeremy Thomas
2024-06-25 22:20:37 +01:00
parent cb2de3a2a2
commit 0014fc4e34
13 changed files with 183 additions and 98 deletions

View File

@@ -0,0 +1,9 @@
export function unslug(slug) {
// Replace hyphens and underscores with spaces
let result = slug.replace(/[-_]/g, " ");
// Capitalize the first letter of each word
return result.replace(/\b\w/g, function (char) {
return char.toUpperCase();
});
}