Skip to content

Conversation

@klmhyeonwoo
Copy link
Member

Description

  • 새로운 타입 체킹 유틸 함수(typeUtil)가 추가되었어요
  • 개별 패키지 익스포트 방식을 추가했어요
    • 기존에는 아래와 같이 사용했는데, 조금 더 확장성을 고려했어요.
    import { typeUtil } from 'kr-corekit';
    const { isPlainObject} = typeUtil;
    
    import { isPlainObject } = 'kr-corekit';
    const checkType = isPlainObject({ a: 6 });
  • clearNullProperties 유틸 함수의 일부 버그를 수정했어요
    • false인 경우 값을 그대로 두지 않고 보정 처리하는 버그
    • 배열 값이 존재하는 경우 객체로 반환하는 버그

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 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 typeUtil package with isPlainObject function for distinguishing plain objects from arrays and other object types
  • Enhanced export strategy to support both namespace and individual function imports
  • Fixed clearNullProperties to 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.

@klmhyeonwoo
Copy link
Member Author

klmhyeonwoo commented Sep 23, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 80.06% 233 / 291
🔵 Statements 80.06% 233 / 291
🔵 Functions 95.65% 22 / 23
🔵 Branches 93.2% 96 / 103
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
package/objectUtil/clearNullProperties/index.ts 100% 100% 100% 100%
package/typeUtil/isPlainObject/index.ts 100% 100% 100% 100%
Generated in workflow #71 for commit e257573 by the Vitest Coverage Report Action

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.

고생하셨습니다~~


return (
Object.getPrototypeOf(value) === Object.prototype ||
Object.getPrototypeOf(value) === null
Copy link
Member

Choose a reason for hiding this comment

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

오.. 이것도 객체를 의미하는 줄 몰랐습니다..!! 👍

@prgmr99 prgmr99 merged commit 36ee333 into main Sep 24, 2025
1 check passed
@klmhyeonwoo klmhyeonwoo deleted the bugfix/42 branch October 21, 2025 07:30
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