-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove undefined values from query string in parseQuery #84
Remove undefined values from query string in parseQuery #84
Conversation
Walkthrough
Changes
Sequence Diagram(s)この変更は具体的なコントロールフローの変更ではなく、関数の内部の条件処理の更新のため、シーケンス図の生成は不要です。 Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- src/utils/parseQuery.ts (1 hunks)
- tests/utils/parseQuery.test.ts (1 hunks)
Additional comments not posted (6)
src/utils/parseQuery.ts (1)
17-19
: undefined 以外の値を適切に処理しています。この変更により、クエリ文字列に
undefined
値が含まれることがなくなり、関数のロバスト性が向上しています。tests/utils/parseQuery.test.ts (5)
10-10
: このテストケースは変更されていません。既存のテストケースは正しく機能していますので、この部分についてのコメントは不要です。
18-18
: このテストケースは変更されていません。型安全性を保証するための重要なテストケースですが、変更はありません。
22-30
: 新しい機能の動作を正しく検証しています。
undefined
値がクエリ文字列から削除されることを確認するテストケースです。新しい機能に対する適切なテストが行われています。
32-40
: 複数のundefined
値に対応するテストを適切に行っています。複数の
undefined
値が存在する場合に、それらが正しく削除されることを検証するテストケースです。新しい機能のテストカバレッジを拡大しています。
42-50
: すべての値がundefined
の場合の動作を正しく検証しています。すべての値が
undefined
である場合に、クエリ文字列が空になることを確認するテストケースです。重要なエッジケースを適切にテストしています。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応ありがとうございます!LGTM!
v3.0.0以上で
getAllContentIds
メソッドの返り値が空の配列になる問題を解消するPRとなります。既存の仕様だとクエリパラメーターに
key=undefined
が渡ることがありましたが、プロパティにundefinedが渡った場合はkeyとともにクエリパラメーターには含まないようロジックを変更しています。なお、
undefined
以外もクエリパラメーターに渡さない場合を考慮するには条件を追加する必要があります。Summary by CodeRabbit
バグ修正
undefined
のキーと値のペアを除外するように変更しました。テスト
undefined
値が結果のクエリ文字列から除外されることを確認するためのテストを追加しました。