Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#270 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
1
フォーク
9
平均マージ
7時間 34分
マージ済み PR(30日)
146

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codercops/toolbelt のほかの issue

codercops/toolbelt の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。