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

Logger options type #1835

Closed
UndefinedBehaviour opened this issue Oct 24, 2023 · 2 comments
Closed

Logger options type #1835

UndefinedBehaviour opened this issue Oct 24, 2023 · 2 comments

Comments

@UndefinedBehaviour
Copy link
Contributor

UndefinedBehaviour commented Oct 24, 2023

This code makes the TS compiler scream because because "LoggerOptions" has no "hello" key (the exact error is Argument of type '{ hello: number; }' is not assignable to parameter of type 'LoggerOptions | DestinationStream | undefined'). I think this is the correct behavior.

import pino from 'pino';

const log = pino({
 hello: 100
});

On the other hand this code doesn't seem to raise any error, i.e. if the object passed as a parameter contains at least one legit key no exception is raised. Is this intended behavior?

import pino from 'pino';

const log = pino({
 safe: true,
 hello: 100
});
@UndefinedBehaviour UndefinedBehaviour closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2023
@UndefinedBehaviour
Copy link
Contributor Author

fixed by #1858

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant