-
Notifications
You must be signed in to change notification settings - Fork 419
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
finished #372
base: master
Are you sure you want to change the base?
finished #372
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 meeting the core requirements of the task! 🎉 While there are some minor improvements suggested, such as enhancing error messages for clarity and adjusting the ESLint configuration for better readability, these do not impact the functionality of your code. Keep up the good work, and consider these suggestions for future enhancements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
rules: { | ||
'no-proto': 0 | ||
'no-proto': 0, | ||
}, | ||
plugins: ['jest'] | ||
plugins: ['jest'], |
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.
Consider placing the 'plugins' property before the 'rules' property for better readability and to follow conventional ESLint configuration order.
|
||
return stats.isDirectory(); | ||
} catch (error) { | ||
console.error(error); |
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.
Consider providing a more descriptive error message here to help with debugging.
// console.log('start'); | ||
// | ||
if (!destinationPath) { | ||
console.error('no second param'); |
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.
Consider providing a more descriptive error message here to help with debugging.
|
||
try { | ||
if (await isDirectory(sourcePath)) { | ||
console.error('sourcePath is the directory'); |
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.
Consider providing a more descriptive error message here to help with debugging.
|
||
try { | ||
if (await isDirectory(destinationPath)) { | ||
console.error('destinationPath is the directory'); |
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.
Consider providing a more descriptive error message here to help with debugging.
if (sourcePath === destinationPath) { | ||
return; | ||
} |
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.
When the source and destination paths are the same, consider providing a warning message to inform the user that no action was taken.
await fs.access(sourcePath, fs.constants.F_OK); | ||
// console.log('copyFile'); | ||
} catch (err) { | ||
console.error('Файл не существует'); |
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.
Consider providing a more descriptive error message here to help with debugging.
await fs.cp(sourcePath, destinationPath); | ||
// console.log('file copied'); | ||
} catch (err) { | ||
// console.error(err); |
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.
Consider uncommenting this line if you want to log errors during the file copy operation, or remove it if it's not needed.
No description provided.