Skip to content

Commit

Permalink
feat: account for create/delete as well as delete/create
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjohnson145 committed May 5, 2022
1 parent 3ce477a commit ea37943
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ var (
create = []string{Create}
read = []string{Read}
update = []string{Update}
recreate = []string{Delete, Create}
deleteCreate = []string{Delete, Create}
createDelete = []string{Create, Delete}
delete_ = []string{Delete}
)

Expand Down Expand Up @@ -90,7 +91,9 @@ func getOutput(change ChangeRepr) *Output {
o.Type = Read
case arrayEqual(change.Change.Actions, update):
o.Type = Update
case arrayEqual(change.Change.Actions, recreate):
case arrayEqual(change.Change.Actions, deleteCreate):
o.Type = Recreate
case arrayEqual(change.Change.Actions, createDelete):
o.Type = Recreate
case arrayEqual(change.Change.Actions, delete_):
o.Type = Delete
Expand Down

0 comments on commit ea37943

Please sign in to comment.