Skip to content

Commit

Permalink
added changes
Browse files Browse the repository at this point in the history
  • Loading branch information
helga16 committed Nov 13, 2024
1 parent 267f069 commit 0ea9114
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/convertToObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* @return {object}
*/
function convertToObject(sourceString) {
const arrayWithStyles = complexStylesString.split(';')
const arrayWithStyles = sourceString.split(';')
.map((el) => el.trim());
const resultObject = {};

for (const el of arrayWithStyles) {
const pair = el.split(':').map((el) => el.trim());
for (const elem of arrayWithStyles) {
const pair = elem.split(':').map((el) => el.trim());
resultObject[pair[0]] = pair[1];
}

Expand Down

0 comments on commit 0ea9114

Please sign in to comment.