diff --git a/index.js b/index.js deleted file mode 100644 index 04bf26ec6..000000000 --- a/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log('Happy developing ✨') diff --git a/package.json b/package.json index 20c7ef705..b8daf8250 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,30 @@ { - "name": "${PROJECT_NAME}", + "name": "style-to-object", "version": "1.0.0", - "description": "", - "main": "index.js", + "description": "Convert style string to object", + "main": "src/convertToObject.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "init": "mate-scripts init", + "start": "mate-scripts start", + "format": "prettier --ignore-path .prettierignore --write './src/**/*.{html,css,scss,js}'", + "lint": "npm run format && mate-scripts lint", + "test:only": "mate-scripts test", + "update": "mate-scripts update", + "postinstall": "npm run update", + "test": "npm run lint && npm run test:only" }, - "private": true + "author": "Mate academy", + "license": "GPL-3.0", + "devDependencies": { + "@mate-academy/eslint-config": "latest", + "@mate-academy/scripts": "^1.8.6", + "eslint": "^8.57.0", + "eslint-plugin-jest": "^28.6.0", + "eslint-plugin-node": "^11.1.0", + "jest": "^29.7.0", + "prettier": "^3.3.2" + }, + "mateAcademy": { + "projectType": "javascript" + } } diff --git a/src/convertToObject.js b/src/convertToObject.js index 62ccb3940..32c556ea4 100644 --- a/src/convertToObject.js +++ b/src/convertToObject.js @@ -6,16 +6,7 @@ * @return {object} */ function convertToObject(sourceString) { - const arrayWithStyles = complexStylesString.split(';') - .map((el) => el.trim()); - const resultObject = {}; - - for (const el of arrayWithStyles) { - const pair = el.split(':').map((el) => el.trim()); - resultObject[pair[0]] = pair[1]; - } - - return resultObject; + // write your code here } module.exports = convertToObject;