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
Allow TS typing of cached value: new NodeCache<MyType>(...)
#273
Comments
new NodeCache<MyType>(...)
new NodeCache<MyType>(...)
Up |
+1 |
We considered using |
This would be great. I was investigating a weird bug and was running out of ideas, until I noticed that one cache was accidentally being used for two different things. I solved the issue by creating a type-safer wrapper around Node-Cache: Adding type-safety to Node-Cache. |
I have been using this library in https://github.com/Mimickal/ReactionRoleBot. I am now porting the project to TypeScript and noticed I always need to specify the type on This issue has been open for nearly 2 years with no movement. Have the developers seen this issue? |
This project seems to be no more under maintenance, |
I've taken the liberty to post a PR addressing this issue. Until this is merged and released, I've managed to apply these changes to my project by overriding the module types in my own project type files (pretty much following the steps here: https://tomsoir.medium.com/typescript-how-to-rewrite-type-definition-file-file-d-ts-of-any-node-modules-package-1eed7f5630d1) The code for my custom definition file is as follows:
|
This would allow custom type enforcing to all methods.
The text was updated successfully, but these errors were encountered: