Skip to content

exchange position but result asymmetry! #11

Open
@ascoders

Description

@ascoders

Occurs when complex objects

json1:

{"component":"gaea-layout","props":{"name":"外壳","options":{"width":{"value":"100%","editable":false},"flexGrow":{"value":1,"editable":false},"flexDirection":{"value":"column"}}},"childs":[{"component":"gaea-layout","childs":[{"component":"title","props":{"options":{"text":{"value":"Gaea"}}}}],"props":{"options":{"alignItems":{"value":"stretch"},"flexDirection":{"value":"column"}}}},{"component":"gaea-layout","childs":[{"component":"gaea-layout","props":{"options":{"width":{"value":"50%"},"alignItems":{"value":"center"},"justifyContent":{"value":"center"},"minHeight":{"value":50}}}},{"component":"gaea-layout","props":{"options":{"width":{"value":"50%"},"alignItems":{"value":"center"},"justifyContent":{"value":"center"},"minHeight":{"value":50}}},"childs":[{"component":"gaea-paragraph","props":{"options":{"text":{"value":"支持自由定制组件+细粒度通用组件"},"fontSize":{"value":16}}}}]}],"props":{"options":{"minHeight":{"value":50}}}},{"component":"gaea-paragraph","props":{"options":{"text":{"value":"无限层级嵌套+任意组合"},"fontSize":{"value":16}}}}]}

json2:

{"component":"gaea-layout","props":{"name":"外壳","options":{"width":{"value":"100%","editable":false},"flexGrow":{"value":1,"editable":false},"flexDirection":{"value":"column"}}},"childs":[{"component":"gaea-layout","childs":[{"component":"title","props":{"options":{"text":{"value":"Gaea"}}}}],"props":{"options":{"alignItems":{"value":"stretch"},"flexDirection":{"value":"column"}}}},{"component":"gaea-layout","childs":[{"component":"gaea-layout","props":{"options":{"width":{"value":"50%"},"alignItems":{"value":"center"},"justifyContent":{"value":"center"},"minHeight":{"value":50}}},"childs":[{"component":"gaea-paragraph","props":{"options":{"text":{"value":"无限层级嵌套+任意组合"},"fontSize":{"value":16}}}}]},{"component":"gaea-layout","props":{"options":{"width":{"value":"50%"},"alignItems":{"value":"center"},"justifyContent":{"value":"center"},"minHeight":{"value":50}}},"childs":[{"component":"gaea-paragraph","props":{"options":{"text":{"value":"支持自由定制组件+细粒度通用组件"},"fontSize":{"value":16}}}}]}],"props":{"options":{"minHeight":{"value":50}}}}]}

and run:

var test1 = require('./test1.json')
var test2 = require('./test2.json')
var map1 = Immutable.fromJS(test1)
var map2 = Immutable.fromJS(test2)

console.log(diff(map1, map2).toJS())
console.log(diff(map2, map1).toJS())

here is the result:

bug

The second is correct

Metadata

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