Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🏷️ Add type definitions for constructorHandlers option #43

Merged

Conversation

alecgibson
Copy link
Contributor

Adds TypeScript definitions for #40

@mcollina mcollina merged commit 6330dc0 into davidmarkclements:master Jun 12, 2024
8 checks passed

const cloneHandlers = rfdc({
constructorHandlers: [
[RegExp, (o) => new RegExp(o)],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if anyone else has better Type-Fu than me, but I can't seem to get the compiler to infer o as type RegExp.

Screenshot 2024-06-12 at 11 17 38

I think this is a limitation of TypeScript

@alecgibson alecgibson deleted the add-constructor-handler-types branch June 12, 2024 10:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants