Skip to content

Conversation

@klmhyeonwoo
Copy link
Member

@klmhyeonwoo klmhyeonwoo commented Sep 20, 2025

Description

  • 실제 사내에서 사용을 하다가 undefined이나 null이 올 경우에 에러를 내보내는데, 그대로 undefined나 null을 리턴하게 하고싶어서 관련 테스트 및 로직을 추가 수정했습니다!

closes: #42

@klmhyeonwoo
Copy link
Member Author

klmhyeonwoo commented Sep 20, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.44% 206 / 266
🔵 Statements 77.44% 206 / 266
🔵 Functions 95.23% 20 / 21
🔵 Branches 91.48% 86 / 94
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
package/stringUtil/escapeHtml/index.ts 100% 100% 100% 100%
package/stringUtil/unescapeHtml/index.ts 100% 100% 100% 100%
Generated in workflow #68 for commit 014ab1c by the Vitest Coverage Report Action

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a runtime error that occurred when undefined or null values were passed to the escapeHtml and unescapeHtml utility functions. The functions now return null or undefined as-is instead of throwing errors.

  • Added null/undefined guards to both functions to handle edge cases gracefully
  • Enhanced test coverage with comprehensive test suites including null/undefined scenarios
  • Improved code organization by wrapping tests in describe blocks

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
package/stringUtil/unescapeHtml/index.ts Added null check guard and reformatted function for better readability
package/stringUtil/unescapeHtml/index.test.ts Added comprehensive test suite with null/undefined handling tests
package/stringUtil/escapeHtml/index.ts Added null check guard to prevent runtime errors
package/stringUtil/escapeHtml/index.test.ts Added comprehensive test suite with null/undefined handling tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@klmhyeonwoo klmhyeonwoo self-assigned this Sep 20, 2025
Copy link
Member

@prgmr99 prgmr99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~~!! 👍

@klmhyeonwoo klmhyeonwoo merged commit 71e8176 into main Sep 21, 2025
1 check passed
@klmhyeonwoo klmhyeonwoo deleted the bugfix/42 branch September 21, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stringUtil > unescapeHtml, escapeHtml에 undefined가 들어갈 경우 에러가 발생하는 현상

3 participants