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

Error thrown when rand().then(console.log) #25

Closed
guidsdo opened this issue Mar 1, 2018 · 4 comments
Closed

Error thrown when rand().then(console.log) #25

guidsdo opened this issue Mar 1, 2018 · 4 comments

Comments

@guidsdo
Copy link

guidsdo commented Mar 1, 2018

In the process of writing the types (for Typescript, so people don't need to read a readme to use this) for this awesome library, I had to test every function and their combinations.

Node version:
8.9.4 (latest stable)

When running the following code:

wordpos.rand().then(console.log);

I get..

(node:99162) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot set property 'count' of undefined
(node:99162) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It does work when I run it with:
rand(console.log) or rand({}).then(console.log).

@moos moos closed this as completed in 4c10324 Mar 4, 2018
@moos
Copy link
Owner

moos commented Mar 4, 2018

Fixed in 1.1.6 -- Thanks!

@guidsdo
Copy link
Author

guidsdo commented Mar 4, 2018

You're welcome! Would you be open to accept the typings for this package in the repo? They will have to be maintained, it's pretty self explanatory and I will help of course

@guidsdo
Copy link
Author

guidsdo commented Mar 4, 2018

@moos
Copy link
Owner

moos commented Mar 6, 2018

First off, appreciate your effort to add types for wordpos. Hopefully it'll be useful to some people.

Are you asking to maintain the .d.ts file in this repo (instead of on DefinitelyTyped)? Would there be a major benefit in doing so (other than saving someone an extra npm install perhaps)?

Also, how much maintenance would be required?

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

No branches or pull requests

2 participants