Skip to content
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

feat(utils): isPrimitive 함수 추가 및 Primitive, Reference 유틸 타입 추가 #217

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

ssi02014
Copy link
Contributor

@ssi02014 ssi02014 commented Jun 11, 2024

Overview

인자로 넣은 value를 Object 래퍼 객체로 감쌌을 때 value가 참조형이라면 동일한 객체를 그대로 반환하는 특징을 이용해 value가 원시값인지 판단하는 isPrimitive 함수를 추가하였습니다.

  • 💡 만약 value가 원시값이라면 래퍼 객체를 반환합니다.

그 외 Primitive, Reference 유틸 타입을 추가합니다.

const obj = {};
console.log(Object(obj) === obj); // true
const number = 1;
console.log(Object(number) === number); // false
// Object(number): Number {1}

PR Checklist

  • All tests pass.
  • All type checks pass.
  • I have read the Contributing Guide document.
    Contributing Guide

@ssi02014 ssi02014 added feature 새로운 기능 추가 @modern-kit/utils @modern-kit/utils @modern-kit/types @modern-kit/types labels Jun 11, 2024
@ssi02014 ssi02014 requested a review from Sangminnn June 11, 2024 15:49
@ssi02014 ssi02014 self-assigned this Jun 11, 2024
Copy link

changeset-bot bot commented Jun 11, 2024

🦋 Changeset detected

Latest commit: ccebd67

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@modern-kit/types Minor
@modern-kit/utils Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.64%. Comparing base (fc43010) to head (ccebd67).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   95.63%   95.64%   +0.01%     
==========================================
  Files          86       87       +1     
  Lines         870      872       +2     
  Branches      203      203              
==========================================
+ Hits          832      834       +2     
  Misses         32       32              
  Partials        6        6              
Components Coverage Δ
@modern-kit/react 92.11% <ø> (ø)
@modern-kit/utils 100.00% <100.00%> (ø)

@ssi02014 ssi02014 merged commit b239f85 into main Jun 12, 2024
3 checks passed
@ssi02014 ssi02014 deleted the feat/isPrimitive branch June 12, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 새로운 기능 추가 @modern-kit/types @modern-kit/types @modern-kit/utils @modern-kit/utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant