mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-10-25 17:42:27 +08:00
* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
10 lines
217 B
TypeScript
10 lines
217 B
TypeScript
const regex = /[^A-Za-z0-9_\- ]/g;
|
|
|
|
export function slugify(value: string): string {
|
|
if (typeof value !== 'string') {
|
|
return '';
|
|
}
|
|
|
|
return value.toLowerCase().replace(regex, '').trim().replace(/ /g, '-');
|
|
}
|