Skip to content

fix(typing): Fix typing API in CaptureConsle #4879

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

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Apr 7, 2022

Fixes #4878 which got introduced in #4863

Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -18,12 +18,12 @@ export class CaptureConsole implements Integration {
/**
* @inheritDoc
*/
private readonly _levels: typeof CONSOLE_LEVELS = CONSOLE_LEVELS;
private readonly _levels: readonly string[] = CONSOLE_LEVELS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private readonly _levels: readonly string[] = CONSOLE_LEVELS;
private readonly _levels: typeof CONSOLE_LEVELS[number] = CONSOLE_LEVELS;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about that one too but that would still break the API. It was string[] before and doing typeof CONSOLE_LEVELS[number] is stricter than that. We could do that in the major bump however.


/**
* @inheritDoc
*/
public constructor(options: { levels?: typeof CONSOLE_LEVELS } = {}) {
public constructor(options: { levels?: string[] } = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public constructor(options: { levels?: string[] } = {}) {
public constructor(options: { levels?: typeof CONSOLE_LEVELS[number] } = {}) {

@lforst lforst enabled auto-merge (squash) April 7, 2022 10:42
@lforst lforst merged commit 5431937 into master Apr 7, 2022
@lforst lforst deleted the lforst-fix-typing-api-captureconsole branch April 7, 2022 10:49
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

Successfully merging this pull request may close these issues.

Broken types on Console integration levels option
2 participants