(title)
| 59 | * @returns {string} The slug/filename for the title. |
| 60 | */ |
| 61 | export const titleToSlug = (title) => |
| 62 | title |
| 63 | .toLowerCase() |
| 64 | .replaceAll( |
| 65 | TITLE_TO_SLUG_CHARS_REGEX, |
| 66 | (char) => TITLE_TO_SLUG_REPLACEMENTS[char], |
| 67 | ) |
| 68 | .normalize('NFD') |
| 69 | .replaceAll(TITLE_TO_SLUG_RANGE_REGEX, ''); |
| 70 | |
| 71 | /** |
| 72 | * Converts a slug into a variable name that can be exported. |
no outgoing calls
no test coverage detected
searching dependent graphs…