@alexlafroscia/yaml-merge
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [4.1.0](https://github.com/alexlafroscia/yaml-merge/compare/v4.0.0...v4.1.0) (2021-06-25) | ||
### Features | ||
* add glob matching ([ded7017](https://github.com/alexlafroscia/yaml-merge/commit/ded7017b74dcb65f1d59fb6a621a639cd3ecc624)) | ||
## [4.0.0](https://github.com/alexlafroscia/yaml-merge/compare/v3.0.0...v4.0.0) (2021-01-04) | ||
@@ -7,0 +14,0 @@ |
@@ -5,2 +5,3 @@ 'use strict'; | ||
const jsYaml = require('js-yaml'); | ||
const glob = require('glob'); | ||
const _ = require('lodash'); | ||
@@ -22,3 +23,6 @@ | ||
function yamlMerge(...from) { | ||
const files = from.map((path) => readAsJSON(path)); | ||
const files = from | ||
.reduce((arr, el) => arr.concat(glob.sync(el)), []) | ||
.map((path) => readAsJSON(path)); | ||
const outputJSON = _.mergeWith({}, ...files, (objValue, srcValue) => { | ||
@@ -25,0 +29,0 @@ if (Array.isArray(objValue) && Array.isArray(srcValue)) { |
{ | ||
"name": "@alexlafroscia/yaml-merge", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "A super simple tool for merging YAML files", | ||
@@ -11,3 +11,6 @@ "main": "index.js", | ||
"test": "mocha", | ||
"release": "standard-version" | ||
"release": "standard-version", | ||
"_postinstall": "husky install", | ||
"prepublishOnly": "pinst --disable", | ||
"postpublish": "pinst --enable" | ||
}, | ||
@@ -19,2 +22,3 @@ "files": [ | ||
"dependencies": { | ||
"glob": "^7.1.7", | ||
"js-yaml": "^4.0.0", | ||
@@ -29,12 +33,8 @@ "lodash": "^4.17.20" | ||
"common-tags": "^1.4.0", | ||
"husky": "^4.3.0", | ||
"husky": "^6.0.0", | ||
"lint-staged": "^10.4.1", | ||
"mocha": "^8.1.3", | ||
"pinst": "^2.1.4", | ||
"standard-version": "^9.0.0" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
@@ -41,0 +41,0 @@ "*.js": "eslint --fix", |
Sorry, the diff of this file is not supported yet
5361
30
3
10
+ Addedglob@^7.1.7
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)