feat: add isEmpty util function#8
Merged
Merged
Conversation
Member
Author
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
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
isEmptyfunction 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
prgmr99
approved these changes
Aug 28, 2025
Member
prgmr99
left a comment
There was a problem hiding this comment.
되게 범용적인 isEmpty네요..!!! 활용도가 아주 좋을 것 같아요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
isEmpty는lodash에서 빈 값을 검증하기 위한 함수와 비슷한 유틸 함수예요Date나,Map,Set에 대한 부분은 사실 신경을 못쓰고 있었는데 어시스턴트로 엣지케이스를 알게되었네요..Symbol의 경우에는Symbol.description을 통해 비교연산으로 리턴 값을 제공합니다.