This function looks very complex, would be good to have a chat about whether this can be condensed down to one or two core functions, or possibly rely on a battle-tested import.
At a minimum it would be good to abstract away all the conditionals, error checking and comments around logging to make the core functionality a bit clearer
Originally posted by @rozifus in https://github.com/flex-dapps/gantree-lib-nodejs/pull/23
Originally posted by @rozifus in https://github.com/flex-dapps/gantree-lib-nodejs/pull/23