dotsunited-merge-json
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -1,6 +0,7 @@ | ||
var _ = require('lodash'); | ||
var merge = require('lodash.merge'); | ||
var isArray = require('lodash.isarray'); | ||
module.exports = function(object, fragment) { | ||
return _.merge(object, fragment, function(a, b) { | ||
if (_.isArray(a)) { | ||
return merge(object, fragment, function(a, b) { | ||
if (isArray(a)) { | ||
return a.concat(b); | ||
@@ -7,0 +8,0 @@ } |
@@ -6,5 +6,6 @@ { | ||
"name": "Jan Sorgalla", | ||
"url": "jan.sorgalla@dotsunited.de" | ||
"email": "jan.sorgalla@dotsunited.de", | ||
"url": "https://dotsunited.de" | ||
}, | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"repository": { | ||
@@ -19,4 +20,5 @@ "type": "git", | ||
"dependencies": { | ||
"lodash": "^3.9.3" | ||
"lodash.isarray": "^3.9.3||^4.0.0", | ||
"lodash.merge": "^3.9.3||^4.0.0" | ||
} | ||
} |
dotsunited-merge-json | ||
===================== | ||
Simple command line utility for merging json files. | ||
Simple command line utility for merging JSON files. | ||
@@ -16,2 +16,4 @@ Installation | ||
Merge JSON files provided as arguments: | ||
```bash | ||
@@ -21,2 +23,4 @@ dotsunited-merge-json file1.json file2.json > merged.json | ||
Merge all JSON files in the current directory: | ||
```bash | ||
@@ -26,3 +30,3 @@ find . -name "*.json" -exec dotsunited-merge-json > ./merged.json {} \; | ||
Pretty-print json with [jq](http://stedolan.github.io/jq/): | ||
Pretty-print JSON with [jq](https://stedolan.github.io/jq/): | ||
@@ -36,3 +40,3 @@ ```bash | ||
Copyright (c) 2015 Dots United GmbH. | ||
Copyright (c) 2015-2016 Dots United GmbH. | ||
Released under the [MIT](LICENSE?raw=1) license. |
Sorry, the diff of this file is not supported yet
34
39
3142
2
5
+ Addedlodash.merge@^3.9.3||^4.0.0
+ Addedlodash.isarray@4.0.0(transitive)
+ Addedlodash.merge@4.6.2(transitive)
- Removedlodash@^3.9.3
- Removedlodash@3.10.1(transitive)