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

Remove unnecessary type check for the key in headersToRecords function #27

Open
coderabbitai bot opened this issue Jul 26, 2024 · 0 comments
Open
Assignees

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 26, 2024

The type check for the key in the headersToRecords function is unnecessary since keys from Object.entries will always be strings. The condition typeof key === "string" can be removed.

File: apps/server/src/headersToRecords.ts
Current Code:

} else if (typeof key === "string" && typeof value === "string") {
  result[key] = value;

Suggested Change:

} else if (typeof value === "string") {
  result[key] = value;

This change will simplify the code and remove the redundant type check.

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

No branches or pull requests

1 participant