Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with Or not working #10

Open
crh225 opened this issue Sep 6, 2016 · 0 comments
Open

Merge with Or not working #10

crh225 opened this issue Sep 6, 2016 · 0 comments

Comments

@crh225
Copy link

crh225 commented Sep 6, 2016

I am trying to merge two objects using or and it is not working.
using

        _.extend = extendify({
            isDeep: true,
            arrays: 'or',
            strings: 'or',
            booleans: 'or',
            numbers: 'or',
            inPlace: false 
        });

first object:

[
  {
    "name": "test",
    "level": "1",
    "children": [
      {
        "name": "October 2014",
        "level": "2",
        "children": [
          {
            "name": "2014-10-03 Typing excercise",
            "level": "3",
            "children": []
          }
        ]
      }
    ]
  }
]

Second Object:

  {
    "name": "Test2",
    "level": "1",
    "children": [
      {
        "name": "September 2013",
        "level": "2",
        "children": [
          {
            "name": "2013-09-12 Angular project",
            "level": "3",
            "children": []
          }
        ]
      }
    ]
  },
  {
    "name": "test",
    "level": "1",
    "children": [
      {
        "name": "September 2014",
        "level": "2",
        "children": [
          {
            "name": "2014-09-14 Last project",
            "level": "3",
            "children": []
          }
        ]
      }
    ]
  }
]

the result I am getting:

[
    {
        "name": "test",
        "level": "1",
        "children": [
            {
                "name": "October 2014",
                "level": "2",
                "children": [
                    {
                        "name": "2014-10-03 Typing excercise",
                        "level": "3",
                        "children": []
                    }
                ]
            }
        ]
    },
    {
        "name": "test",
        "level": "1",
        "children": [
            {
                "name": "September 2014",
                "level": "2",
                "children": [
                    {
                        "name": "2014-09-14 Last project",
                        "level": "3",
                        "children": []
                    }
                ]
            }
        ]
    }
]

expected result:

[
    {
        "name": "test2",
        "level": "1",
        "children": [
            {
                "name": "October 2014",
                "level": "2",
                "children": [
                    {
                        "name": "2014-10-03 Typing excercise",
                        "level": "3",
                        "children": []
                    }
                ]
            }
        ]
    },
    {
        "name": "test",
        "level": "1",
        "children": [
            {
                "name": "September 2014",
                "level": "2",
                "children": [
                    {
                        "name": "2014-09-14 Last project",
                        "level": "3",
                        "children": []
                    }
                ]
            }
        ]
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant