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 is instance of #7

Merged
merged 3 commits into from
Aug 27, 2018
Merged

Feat is instance of #7

merged 3 commits into from
Aug 27, 2018

Conversation

dggluz
Copy link
Collaborator

@dggluz dggluz commented Aug 27, 2018

Description

Adds isInstanceOf variadic function that tells if an object is instance of some class or classes. Use:

const isInstanceOfFoo = isInstanceOf(Foo);

isInstanceOfFoo(new Foo()); // true
isInstanceOfFoo(new Bar()); // false

I added typing tests for this function interacting with caseError, since it's the intended use.

How to test

  • npm t
  • npm run test:types

Related PRs

NOTE: this PR starts from #6, so merge that one first.

@dggluz dggluz added the enhancement New feature or request label Aug 27, 2018
@dggluz dggluz requested a review from hrajchert August 27, 2018 07:51
@dggluz dggluz mentioned this pull request Aug 27, 2018
@dggluz dggluz force-pushed the feat-is-instance-of branch 2 times, most recently from 005dc04 to 2548afc Compare August 27, 2018 17:23
@hrajchert hrajchert force-pushed the feat-is-instance-of branch from 2548afc to 3560c8f Compare August 27, 2018 17:30
Copy link
Contributor

@hrajchert hrajchert left a comment

Choose a reason for hiding this comment

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

LGTM

@hrajchert hrajchert merged commit ecb40ad into master Aug 27, 2018
@hrajchert hrajchert deleted the feat-is-instance-of branch August 27, 2018 17:32
@hrajchert
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants