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

task finished #2757

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

task finished #2757

wants to merge 3 commits into from

Conversation

Fluebubble
Copy link

No description provided.

Copy link

@YuriySobakar YuriySobakar left a comment

Choose a reason for hiding this comment

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

Good job! Approve) Was little bit hard with variables names)

Copy link

@ArtemTeslenko ArtemTeslenko left a comment

Choose a reason for hiding this comment

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

Good job! You can do it in less actions and do not overfill your code by logic, even if you do it not as in my comment 😉

Comment on lines 35 to 39
.reduce((accumulator, param) => {
accumulator[param[0]] = param[1];

return accumulator;
}, objectWithCssParams);

Choose a reason for hiding this comment

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

Good idea to use reduce, but you could process every item inside this method and get rid of other methods like

return sourceString.split(";").reduce((result, style) => {
there you get array from the whole string style.split(":");
there you trim every pair key = yourPair[0]?.trim();
there you trim every pair value = yourPair[1]?.trim();
if (key && value) {
result[key] = value;
}
return result;
}, {});

Copy link
Author

Choose a reason for hiding this comment

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

ESLint forbids "?" before trim :(

Copy link

@ArtemTeslenko ArtemTeslenko left a comment

Choose a reason for hiding this comment

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

Great 🔥

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