Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Your assignment page on Canvas should contain instructions for submitting this p
- [ ] For Exercises 1-7 inside `index.js`:
- [ ] Write the tests in `index.test.js`.
- [ ] Implement the function or the class in `index.js`.
cross-env NODE_ENV=testing

#### Notes

Expand Down
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
*/
function trimProperties(obj) {
// ✨ implement
const result = {}
for (let properties in obj) {
result[properties] = obj[properties].trim()
}
return result
}

/**
Expand All @@ -20,6 +25,10 @@ function trimProperties(obj) {
*/
function trimPropertiesMutation(obj) {
// ✨ implement
for (let properties in obj) {
obj[properties] = obj[properties].trim()
}
return obj
}

/**
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "index.js",
"scripts": {
"dev": "nodemon index.js",
"test": "cross-env NODE_ENV=testing jest --verbose"
"test": "jest --watchAll --verbose"
},
"devDependencies": {
"@types/jest": "^27.4.1",
Expand Down