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

Typing info for log function misses 2nd argument #37

Open
csemrau opened this issue Aug 29, 2019 · 1 comment
Open

Typing info for log function misses 2nd argument #37

csemrau opened this issue Aug 29, 2019 · 1 comment
Labels

Comments

@csemrau
Copy link

csemrau commented Aug 29, 2019

The optional log function is called with 2 arguments, the message and the level (although the level is always 'warn'). The typing information only declares the 1st argument:

log?: (msg: string) => any;

Therefore, the example pool from README.md won't compile in TypeScript:

    log: (message, logLevel) => console.log(`${logLevel}: ${message}`),
@elhigu
Copy link
Collaborator

elhigu commented Sep 2, 2019

Thanks for report. Yes looks like there is a bug. I'll fix and add test case for it when I get some spare time.

https://github.com/Vincit/tarn.js/blob/master/src/Pool.ts#L17

@elhigu elhigu added the bug label Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants