-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Added a new utility function typeUtil & fix: Fix bug in clearNullProperties utility function #47
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
Conversation
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.
Pull Request Overview
This PR introduces a new type utility function isPlainObject and fixes bugs in the existing clearNullProperties function. The changes enhance the library's type checking capabilities and improve the reliability of object property clearing.
- Added
typeUtilpackage withisPlainObjectfunction for distinguishing plain objects from arrays and other object types - Enhanced export strategy to support both namespace and individual function imports
- Fixed
clearNullPropertiesto properly handle falsy values and use type checking for recursive processing
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package/typeUtil/isPlainObject/index.ts | New utility function to check if a value is a plain object |
| package/typeUtil/isPlainObject/index.test.ts | Comprehensive test suite for the isPlainObject function |
| package/typeUtil/index.ts | Export configuration for typeUtil package |
| package/objectUtil/clearNullProperties/index.ts | Bug fixes for proper null/undefined handling and array preservation |
| package/objectUtil/clearNullProperties/index.test.ts | Additional test cases covering the bug fixes |
| package/index.ts | Updated exports to include typeUtil with both namespace and individual exports |
| README.md | Documentation updates for the new typeUtil functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Co-authored-by: Copilot <[email protected]>
prgmr99
left a comment
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.
고생하셨습니다~~
|
|
||
| return ( | ||
| Object.getPrototypeOf(value) === Object.prototype || | ||
| Object.getPrototypeOf(value) === null |
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.
오.. 이것도 객체를 의미하는 줄 몰랐습니다..!! 👍
Description
typeUtil)가 추가되었어요clearNullProperties유틸 함수의 일부 버그를 수정했어요