moos/wordpos

Error thrown when `rand().then(console.log)`

guidsdo opened this issue · 4 comments

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 commented

Fixed in 1.1.6 -- Thanks!

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

moos commented

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?