Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Case converter: Title Case, Sentence case, lowercase and UPPERCASE drop "." and "/"

Abierto
#270 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
tooling

Línea de trabajo

Start with splitWords and convertLine in lib/case-utils.ts, then read the existing test for “keeps punctuation in the prose styles.” Check how the prose styles handle periods and slashes while preserving identifier style behavior; the issue lists the expected outputs and calls for tests plus lint, test, and build to pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

On the case converter, the four prose styles (Title Case, Sentence case, lowercase, UPPERCASE) drop . and /, even though #221 says they keep punctuation and the test keeps punctuation in the prose styles checks it for , and !:

Input Style Now Expected
Hello. World. lowercase hello world hello. world.
Hello. World. Title Case Hello World Hello. World.
it's 3.5 km away lowercase it's 3 5 km away it's 3.5 km away
Read the docs at example.com/start. lowercase read the docs at example com start read the docs at example.com/start.
Pick a/b, then stop UPPERCASE PICK A B, THEN STOP PICK A/B, THEN STOP

3.5 becoming 3 5 changes what the text says, and a sentence loses its full stops.

Cause: splitWords (lib/case-utils.ts, line 37) splits on _, -, ., / and whitespace for every style. That's right for the identifier styles (user.id → userId), but in the prose styles . and / are punctuation, not word boundaries, and convertLine (line 54) joins the words back with spaces.

Suggested fix: in convertLine, split the prose styles on _, - and whitespace only, so . and / stay inside the word like , and ! already do. user_id and userId still give User Id in Title Case. The identifier styles don't change.

One thing to decide: - has the same problem (e-mail → e mail, state-of-the-art → State Of The Art). I've left it as a separator in the suggestion, since kebab-case-name → Kebab Case Name may be what you want there. Happy to keep hyphens too if you'd rather.

Acceptance criteria

  • Every row in the table gives the expected output
  • user_id and userId still give User Id in Title Case, and the identifier styles don't change
  • Tests for these cases
  • npm run lint, npm run test and npm run build pass

I'd like to work on this if you agree it's a bug.

Lenguaje dominante
TypeScript
Estrellas
1
Forks
9
Merge medio
9 h 9 min
PR fusionados (30 d)
118

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codercops/toolbelt

Todos los issues de codercops/toolbelt

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.