fix d2oracle
This commit is contained in:
parent
ba35a3173f
commit
c57d0ee252
2 changed files with 33 additions and 1 deletions
|
|
@ -2066,7 +2066,13 @@ func hasSpace(tag string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getMostNestedRefs(obj *d2graph.Object) []d2graph.Reference {
|
func getMostNestedRefs(obj *d2graph.Object) []d2graph.Reference {
|
||||||
most := obj.References[0]
|
var most d2graph.Reference
|
||||||
|
for _, ref := range obj.References {
|
||||||
|
if len(ref.MapKey.Edges) == 0 {
|
||||||
|
most = ref
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
for _, ref := range obj.References {
|
for _, ref := range obj.References {
|
||||||
if len(ref.MapKey.Edges) != 0 {
|
if len(ref.MapKey.Edges) != 0 {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -2001,6 +2001,32 @@ c: {
|
||||||
assert.JSON(t, len(g.Objects), 3)
|
assert.JSON(t, len(g.Objects), 3)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "underscore-connection",
|
||||||
|
|
||||||
|
text: `a: {
|
||||||
|
b
|
||||||
|
|
||||||
|
_.c.d -> b
|
||||||
|
}
|
||||||
|
|
||||||
|
c: {
|
||||||
|
d
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
key: `a.b`,
|
||||||
|
newKey: `c.b`,
|
||||||
|
|
||||||
|
exp: `a: {
|
||||||
|
_.c.d -> _.c.b
|
||||||
|
}
|
||||||
|
|
||||||
|
c: {
|
||||||
|
d
|
||||||
|
b
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "flat_middle_container",
|
name: "flat_middle_container",
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue