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

clint - pr feedback for #78 #83

Closed
wants to merge 7 commits into from

Conversation

jurassix
Copy link

No description provided.

@jurassix jurassix changed the title clint - pr feedbacl #78 clint - pr feedback for #78 Jan 17, 2024
@jurassix jurassix changed the base branch from master to ryanwang/capture-console-logs January 17, 2024 10:39
Comment on lines +60 to +62
if (!this._isActive) {
return
}
Copy link
Author

Choose a reason for hiding this comment

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

prefer to short circuit over indent

this._shims[logLevel as ConsoleLevels] = undefined;
}
this._isActive = false;
let logLevel: ConsoleLevels;
Copy link
Author

Choose a reason for hiding this comment

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

we can drop all the casts by strongly typing the key.

@@ -73,6 +72,7 @@ declare global {
fsTagName?: string;
}
}
let __turboModuleProxy: boolean;
Copy link
Author

Choose a reason for hiding this comment

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

define the variable on the global scope

@@ -44,7 +43,6 @@ const logEvent = (level: LogLevel, args: ArrayLike<unknown>) => {
};

// A naive version of ConsoleWatcher on web.
// See https://github.com/cowpaths/mn/blob/865353f374b687e481d3b230e7eec8e1d7be2eb4/projects/fullstory/packages/recording/src/consolewatcher.ts
Copy link
Author

Choose a reason for hiding this comment

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

doesn't seem useful to ref an internal repo

@@ -30,7 +29,7 @@ type ConsoleLevels = keyof typeof consoleLevelMap;
type MethodShim = Record<'native' | 'override', Function>;

type ConsoleShims = {
[K in keyof typeof consoleLevelMap]?: MethodShim | null;
Copy link
Author

Choose a reason for hiding this comment

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

keyof typeof consoleLevelmap is already defined above as ConsoleLevels

@RyanCommits RyanCommits force-pushed the ryanwang/capture-console-logs branch from 23dcb27 to ac6011c Compare May 1, 2024 15:14
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.

2 participants