Skip to content

feat: add isEmpty util function#8

Merged
klmhyeonwoo merged 5 commits into
mainfrom
feature/util-workspace
Aug 28, 2025
Merged

feat: add isEmpty util function#8
klmhyeonwoo merged 5 commits into
mainfrom
feature/util-workspace

Conversation

@klmhyeonwoo
Copy link
Copy Markdown
Member

Description

  • isEmptylodash에서 빈 값을 검증하기 위한 함수와 비슷한 유틸 함수예요
  • Date나, Map, Set에 대한 부분은 사실 신경을 못쓰고 있었는데 어시스턴트로 엣지케이스를 알게되었네요..
  • Symbol의 경우에는 Symbol.description을 통해 비교연산으로 리턴 값을 제공합니다.

@klmhyeonwoo klmhyeonwoo requested review from Copilot and prgmr99 August 28, 2025 03:19
@klmhyeonwoo
Copy link
Copy Markdown
Member Author

klmhyeonwoo commented Aug 28, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 45.5% 76 / 167
🔵 Statements 45.5% 76 / 167
🔵 Functions 55% 11 / 20
🔵 Branches 80.39% 41 / 51
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
package/index.ts 0% 0% 0% 0% 1-6
package/commonUtil/index.ts 0% 0% 0% 0% 1
package/commonUtil/isEmpty/index.ts 100% 100% 100% 100%
Generated in workflow #21 for commit 7efa5c0 by the Vitest Coverage Report Action

Copy link
Copy Markdown
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 isEmpty utility function to the package, similar to lodash's isEmpty function for validating empty values. The implementation handles various data types including primitives, collections, and edge cases like Date objects, Map/Set, and Symbols.

  • Adds isEmpty function with comprehensive type checking for null, undefined, numbers (including NaN), strings, arrays, objects, Date, Map, Set, and Symbol types
  • Includes extensive test coverage with edge case handling
  • Exports the new utility through a commonUtil module

Reviewed Changes

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

File Description
package/index.ts Exports the new commonUtil module
package/commonUtil/isEmpty/index.ts Implements the isEmpty utility function with multi-type support
package/commonUtil/isEmpty/index.test.ts Comprehensive test suite covering all supported types and edge cases
package/commonUtil/index.ts Exports the isEmpty function from the commonUtil module

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

Comment thread package/commonUtil/isEmpty/index.ts Outdated
Comment thread package/commonUtil/isEmpty/index.ts
Comment thread package/commonUtil/isEmpty/index.ts Outdated
klmhyeonwoo and others added 3 commits August 28, 2025 12:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
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.

되게 범용적인 isEmpty네요..!!! 활용도가 아주 좋을 것 같아요!

@klmhyeonwoo klmhyeonwoo merged commit 59e297d 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