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

add task solution #800

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add task solution #800

wants to merge 4 commits into from

Conversation

4xmplme
Copy link

@4xmplme 4xmplme commented Nov 24, 2024

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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! ✨

Comment on lines 9 to 15
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>".',
});
}

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.

Copy link

@SanyaBratashchuk SanyaBratashchuk left a 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

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.

3 participants