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 isCallable() and isConstructable() #52

Open
jcbhmr opened this issue Jun 2, 2023 · 1 comment
Open

Add isCallable() and isConstructable() #52

jcbhmr opened this issue Jun 2, 2023 · 1 comment

Comments

@jcbhmr
Copy link
Collaborator

jcbhmr commented Jun 2, 2023

https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md

☝ Basically that.

Use case:

if (isConstructable(thing)) {
  return new thing()
} else if (isCallable(thing)) {
  return thing()
} else {
  return thing
}
@jcbhmr jcbhmr added the question Further information is requested label Jun 2, 2023
@mesqueeb
Copy link
Owner

mesqueeb commented Jun 3, 2023

Seems good to me! PR welcome

@jcbhmr jcbhmr removed the question Further information is requested label Jun 3, 2023
@jcbhmr jcbhmr changed the title Consider adding isCallable() and isConstructable()? Add isCallable() and isConstructable() Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants