Skip to content

Conversation

@prgmr99
Copy link
Member

@prgmr99 prgmr99 commented Aug 27, 2025

Description

  • validationUtil

    • checkHttpUrl 유틸함수를 추가합니다.
    • http 또는 https로 시작하는지 정규식으로 빠르게 1차 검사합니다.
    • 웹 표준 URL 생성자(new URL())를 사용하여 URL 유효성을 검증합니다.
  • 테스트 케이스

    • 유효한 URL 케이스:
      일반적인 http/https 주소, 서브도메인, 포트 번호, 쿼리 파라미터 등을 포함하여 검증합니다.
    • 유효하지 않은 URL 케이스:
      프로토콜이 없는 경우, 상대 경로, ftp/mailto 등 다른 프로토콜, 공백 포함, 빈 문자열 등 다양한 엣지 케이스를 검증합니다.

@prgmr99 prgmr99 requested a review from klmhyeonwoo August 27, 2025 08:54
@prgmr99 prgmr99 self-assigned this Aug 27, 2025
@klmhyeonwoo
Copy link
Member

klmhyeonwoo commented Aug 27, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 38.62% 56 / 145
🔵 Statements 38.62% 56 / 145
🔵 Functions 55.55% 10 / 18
🔵 Branches 70.96% 22 / 31
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
package/validationUtil/index.ts 0% 0% 0% 0% 1-2
package/validationUtil/checkHttpUrl/index.ts 100% 100% 100% 100%
Generated in workflow #15 for commit 9278cc0 by the Vitest Coverage Report Action

@klmhyeonwoo klmhyeonwoo requested a review from Copilot August 27, 2025 15:24
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 adds a new utility function checkHttpUrl to the validationUtil module for validating HTTP/HTTPS URLs. The implementation uses a two-step validation approach: first checking the protocol with a regex pattern, then using the native URL constructor for complete validation.

  • Adds checkHttpUrl function with regex pre-validation and URL constructor validation
  • Comprehensive test coverage with 16 test cases covering valid and invalid URL scenarios
  • Exports the new function from the validationUtil module

Reviewed Changes

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

File Description
package/validationUtil/index.ts Exports the new checkHttpUrl function
package/validationUtil/checkHttpUrl/index.ts Implements the URL validation function with regex and URL constructor
package/validationUtil/checkHttpUrl/index.test.ts Comprehensive test suite with valid and invalid URL test cases
vitest-report.xml Test report showing all 16 tests passing

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

@prgmr99 prgmr99 merged commit c6d9a8b into main Aug 28, 2025
1 check passed
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.

3 participants