When running the enforcer multiple times with the same options object the second pass will throw an error:
options.exceptionSkipCodes.reduce is not a function
What seems to happen is that in the first pass options.exceptionSkipCodes is changed from an array to an object. This change is a side effect that causes the error to be thrown on the second pass where it essentially tries to do {}.reduce() instead of [].reduce().
It looks like the same side effect is created for options.exceptionEscalateCodeson this line
I've solved this for now by cloning my options object before passing it to the enforcer.
This seems to be an issue since this line was changed.
When running the enforcer multiple times with the same options object the second pass will throw an error:
What seems to happen is that in the first pass
options.exceptionSkipCodes
is changed from an array to an object. This change is a side effect that causes the error to be thrown on the second pass where it essentially tries to do{}.reduce()
instead of[].reduce()
.It looks like the same side effect is created for
options.exceptionEscalateCodes
on this lineI've solved this for now by cloning my options object before passing it to the enforcer.