-
Notifications
You must be signed in to change notification settings - Fork 820
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
add task solution #800
base: master
Are you sure you want to change the base?
add task solution #800
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the createServer
function! 🎉 Your code meets all the task requirements and handles HTTP requests, URL parsing, and input validation effectively. There's a small opportunity for improvement by removing a redundant check, which can simplify your code. Keep up the excellent work and continue refining your skills! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
src/createServer.js
Outdated
if (!path || path === '/') { | ||
errors.push({ | ||
message: | ||
// eslint-disable-next-line max-len | ||
'Text to convert is required. Correct request is: "/<TEXT_TO_CONVERT>?toCase=<CASE_NAME>".', | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for !path || path === '/'
is redundant because textToConvert
is derived from path.slice(1)
, which will be an empty string if path
is '/'. Therefore, the check on line 19 already covers this case. You can remove this block to simplify the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests are failed. try to pass them. If you have any questions feel free to ask in chat
No description provided.