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

Add isInstanceOf(value, classNameOrClass) #38

Merged
merged 4 commits into from
May 31, 2023
Merged

Add isInstanceOf(value, classNameOrClass) #38

merged 4 commits into from
May 31, 2023

Conversation

jcbhmr
Copy link
Collaborator

@jcbhmr jcbhmr commented May 26, 2023

fixes #36
This PR would...

  • add isInstanceOf() source
  • have a JSDoc comment describing what it does
  • add a test case to the test file

@jcbhmr jcbhmr marked this pull request as ready for review May 30, 2023 20:54
@mesqueeb mesqueeb changed the base branch from production to dev May 31, 2023 01:04
@mesqueeb mesqueeb closed this May 31, 2023
@mesqueeb mesqueeb reopened this May 31, 2023
@mesqueeb mesqueeb closed this May 31, 2023
@mesqueeb mesqueeb reopened this May 31, 2023
src/index.ts Show resolved Hide resolved
test/index.test.ts Show resolved Hide resolved
Copy link
Owner

@mesqueeb mesqueeb left a comment

Choose a reason for hiding this comment

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

@jcbhmr
Can you add something on isInstanceOf to the readme? and above the ### Getting and checking for specific types section.
Will open a new issue for this.


for the JSDocs on the overloads I meant this:
2023-05-31 12 47 02

but i guess this is pretty rare that people click that button and it's better to keep it non-duplicated I guess!

@mesqueeb mesqueeb merged commit 5895bc8 into mesqueeb:dev May 31, 2023
3 checks passed
@jcbhmr jcbhmr deleted the add-is-instance-of branch May 31, 2023 04:35
@jcbhmr
Copy link
Collaborator Author

jcbhmr commented May 31, 2023

for the JSDocs on the overloads I meant this:

Ahh! I see what you mean now! 👍

For reference, the official TypeScript way of doing it is: https://github.com/microsoft/TypeScript/blob/main/src/lib/es2023.array.d.ts#L2-L12
image

so I don't think it's that big of a deal when the official TS lib.d.ts files are just a single JSDoc comment 🤷‍♀️

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.

Consider isInstanceOf() based on string tags?
2 participants