feat: some more tests
This commit is contained in:
@@ -12,6 +12,11 @@ import (
|
||||
// - when obj is a map -> if value is a map[string]any, merge into obj; otherwise obj is unchanged.
|
||||
// - otherwise -> returns obj unchanged.
|
||||
func SetPathValue(path string, value any, obj any) any {
|
||||
// check if value is empty string and if so continue
|
||||
if value == "" || value == nil {
|
||||
return obj
|
||||
}
|
||||
|
||||
// Split and drop empty segments (so ".", "..", "" become no keys)
|
||||
raw := strings.Split(path, ".")
|
||||
keys := raw[:0]
|
||||
|
Reference in New Issue
Block a user