Skip to content

Commit

Permalink
task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
szymanski-marcin committed Nov 14, 2023
1 parent 9b9a80d commit 2b210f7
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand Down
81 changes: 67 additions & 14 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 @@ -16,7 +16,7 @@
"license": "GPL-3.0",
"devDependencies": {
"@mate-academy/eslint-config": "*",
"@mate-academy/scripts": "^0.3.6",
"@mate-academy/scripts": "^1.2.9",
"eslint": "^5.16.0",
"eslint-plugin-jest": "^22.4.1",
"eslint-plugin-node": "^8.0.1",
Expand Down
14 changes: 13 additions & 1 deletion src/makeRobotAccountant.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@
*/

function makeRobotAccountant() {
// write code here
let count = 0;

return function(a) {
return function(b) {
count++;

if (count > 3 && count % 2 === 0) {
return 'Bzzz... Error!';
}

return a + b;
};
};
}

module.exports = makeRobotAccountant;

0 comments on commit 2b210f7

Please sign in to comment.