Skip to content

Why return path.length - 1 for object operations? #36

Open
@happy15

Description

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?

json0 rocks and looking forward to some hints.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions