diff --git a/.eslintrc b/.eslintrc index bec601d..0625ffa 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,18 +1,6 @@ env: node: true -# enable ECMAScript features -ecmaFeatures: - blockBindings: true - templateStrings: true - octalLiterals: true - binaryLiterals: true - generators: true - forOf: true - objectLiteralShorthandProperties: true - objectLiteralShorthandMethods: true - classes: true - rules: # Possible Errors # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors @@ -49,7 +37,7 @@ rules: ## require spaces operator like var sum = 1 + 1; space-infix-ops: 2 ## require spaces return, throw, case - space-return-throw-case: 2 + keyword-spacing: 2 ## no space before function, eg. 'function()' space-before-function-paren: [2, "never"] ## require space before blocks, eg 'function() {}' @@ -64,8 +52,6 @@ rules: eol-last: 2 ## no trailing spaces no-trailing-spaces: 2 - # require space after keywords, eg 'for (..)' - space-after-keywords: 2 # Strict Mode # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode diff --git a/.travis.yml b/.travis.yml index 94f876e..abc8c02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: "node_js" node_js: - - "0.10" - - "0.12" - - "iojs" - - "4.0" + - node + - lts/* script: npm run lint && npm run coveralls diff --git a/lib/merge.js b/lib/merge.js index ba6aeb2..cb60939 100644 --- a/lib/merge.js +++ b/lib/merge.js @@ -9,12 +9,12 @@ module.exports = function merge(patch1, patch2) { var patch = JSON.parse(JSON.stringify(patch1)); Object.keys(patch2) - .forEach(function(key) { - if (patch1[key] !== undefined) { - patch[key] = merge(patch1[key], patch2[key]); - } else { - patch[key] = patch2[key]; - } - }); + .forEach(function(key) { + if (patch1[key] !== undefined) { + patch[key] = merge(patch1[key], patch2[key]); + } else { + patch[key] = patch2[key]; + } + }); return patch; }; diff --git a/package.json b/package.json index c34518c..6b404e3 100644 --- a/package.json +++ b/package.json @@ -7,17 +7,17 @@ "test": "test" }, "devDependencies": { - "chai": "^3.2.0", - "coveralls": "^2.11.2", - "eslint": "^1.4.3", - "istanbul": "^0.3.11", - "mocha": "^2.3.2" + "chai": "^4.2.0", + "coveralls": "^3.1.0", + "eslint": "^7.0.0", + "istanbul": "^0.4.5", + "mocha": "^7.1.2" }, "scripts": { "test": "NODE_ENV=test mocha -b --reporter spec --recursive test", "lint": "eslint ./lib ./index.js", "coverage": "istanbul cover _mocha -- -R spec --recursive test", - "coveralls": "istanbul cover _mocha -- -R spec --recursive test; cat ./coverage/lcov.info | coveralls.js || true" + "coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec --recursive test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage" }, "repository": { "type": "git", @@ -37,6 +37,6 @@ }, "homepage": "https://github.com/pierreinglebert/json-merge-patch", "dependencies": { - "deep-equal": "^1.0.0" + "deep-equal": "^2.0.3" } }