Skip to content

Commit

Permalink
add unmatch handler on root
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlewind committed Jan 8, 2018
1 parent d40a629 commit 51c0011
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bumpover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ export class Bumpover {
// Resolve default value if root node is unknown.
if (!rule) {
if (ignoreUnknown) resolve(defaultValue)
else bumpRoot(rootNode, options, bumpNode, resolve, reject)
else {
this.options.onUnmatch(rootNode)
bumpRoot(rootNode, options, bumpNode, resolve, reject)
}
} else {
rule.update(rootNode).then(result => {
const { childKey, serializer, defaultValue } = options
Expand Down

0 comments on commit 51c0011

Please sign in to comment.