Open
Conversation
… nested. 0 = no nesting, 1 = only one depth, ...
Contributor
|
Thanks for the conribution. This is a difficult one since it is a breaking change. Happy to accept with the following change. Add a fuction that takes the depth parameter and the existing function can stay the same. The existing function should just be a passthrough to the one with a depth parameter. We'd need these for both explodeMap and explodeList e.g. func explodeMap(l interface{}, parent string, delimiter string) (map[string]interface{}, error) {
explodeMapWithDepth(i, parent, delimiter, -1)
}and func explodeMapWithDepth(l interface{}, parent string, delimiter string, depth int) (map[string]interface{}, error) {
...
...
} |
Contributor
|
Also, if you could squash your commits before submitting the PR, I'd really appreciate it since this is a single change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We needed an option to require a maximum depth of nesting. The default behaviour still works with specifying a negative value
-1, no nesting is done with0and depth can be specified with any values above.I don't know if you still maintain the project, but if this is interesting for you please feel free to merge, then I'd remove our fork. Otherwise feel free to ignore :-)
Added also some further test cases to test for the depth and a different merge character.
Note : This is a breaking change, since a parameter was added.
Cheers!