It makes sense to return path.length-1 as common length for list operations since the last element of path for list operations are index.
But why the same for object operations? If object operation A can be transformed regarding object operation B, A.p should be a strict prefix array of B.p. The part to transform object operations did that by checking c.p[common] and otherC.p[common] again.
From the code using the result common of json0.transformComponent(...) I see that it will access the last element by p[common], so it's just for implementation convenience (no more p[common-1]) or serve other purposes?
It makes sense to return path.length-1 as common length for list operations since the last element of path for list operations are index.
But why the same for object operations? If object operation A can be transformed regarding object operation B, A.p should be a strict prefix array of B.p. The part to transform object operations did that by checking c.p[common] and otherC.p[common] again.
From the code using the result
common
ofjson0.transformComponent(...)
I see that it will access the last element byp[common]
, so it's just for implementation convenience (no more p[common-1]) or serve other purposes?json0 rocks and looking forward to some hints.