{"action":"created","issue":{"url":"https://api.github.com/repos/CoursePark/NestHydrationJS/issues/23","repository_url":"https://api.github.com/repos/CoursePark/NestHydrationJS","labels_url":"https://api.github.com/repos/CoursePark/NestHydrationJS/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/CoursePark/NestHydrationJS/issues/23/comments","events_url":"https://api.github.com/repos/CoursePark/NestHydrationJS/issues/23/events","html_url":"https://github.com/CoursePark/NestHydrationJS/issues/23","id":339967568,"node_id":"MDU6SXNzdWUzMzk5Njc1Njg=","number":23,"title":"nesting beyond one level","user":{"login":"bvitale","id":631011,"node_id":"MDQ6VXNlcjYzMTAxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/631011?v=4","gravatar_id":"","url":"https://api.github.com/users/bvitale","html_url":"https://github.com/bvitale","followers_url":"https://api.github.com/users/bvitale/followers","following_url":"https://api.github.com/users/bvitale/following{/other_user}","gists_url":"https://api.github.com/users/bvitale/gists{/gist_id}","starred_url":"https://api.github.com/users/bvitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvitale/subscriptions","organizations_url":"https://api.github.com/users/bvitale/orgs","repos_url":"https://api.github.com/users/bvitale/repos","events_url":"https://api.github.com/users/bvitale/events{/privacy}","received_events_url":"https://api.github.com/users/bvitale/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-10T18:58:41Z","updated_at":"2018-07-11T15:08:39Z","closed_at":"2018-07-11T15:08:39Z","author_association":"NONE","body":"Here is a program which uses two different definitions against the same data.  The first shape works but the second does not work as I would expect. See below.\r\n\r\n```\r\nconst NestHydrationJS = require('nesthydrationjs')();\r\n\r\nconst data = [\r\n  {\r\n    col1: 'value',\r\n    col2: 'nestedValue1'\r\n  },\r\n  {\r\n    col1: 'value2',\r\n    col2: 'nestedValue2'\r\n  }\r\n];\r\n\r\nconst shape = [{\r\n  prop: 'col1',\r\n  nested: {\r\n    value: 'col2'\r\n  }\r\n}];\r\n\r\nconsole.log(JSON.stringify(NestHydrationJS.nest(data, shape), null, 2));\r\n\r\nconst shape2 = [{\r\n  prop: 'col1',\r\n  nested: {\r\n    twice: {\r\n      value: 'col2'\r\n    }\r\n  }\r\n}];\r\n\r\nconsole.log(JSON.stringify(NestHydrationJS.nest(data, shape2), null, 2));\r\n```\r\n\r\nOutput:\r\n```\r\n[\r\n  {\r\n    \"prop\": \"value\",\r\n    \"nested\": {\r\n      \"value\": \"nestedValue1\"\r\n    }\r\n  },\r\n  {\r\n    \"prop\": \"value2\",\r\n    \"nested\": {\r\n      \"value\": \"nestedValue2\"\r\n    }\r\n  }\r\n]\r\n[\r\n  {\r\n    \"prop\": \"value\",\r\n    \"nested\": {\r\n      \"twice\": {\r\n        \"value\": \"nestedValue1\"\r\n      }\r\n    }\r\n  },\r\n  {\r\n    \"prop\": \"value2\",\r\n    \"nested\": {\r\n      \"twice\": {\r\n        \"value\": \"nestedValue1\"\r\n      }\r\n    }\r\n  }\r\n]\r\n```\r\n\r\nNote in the second example, \"nestedValue1\" is repeated into both objects. Is this level of nesting supported? Thanks!"},"comment":{"url":"https://api.github.com/repos/CoursePark/NestHydrationJS/issues/comments/404204501","html_url":"https://github.com/CoursePark/NestHydrationJS/issues/23#issuecomment-404204501","issue_url":"https://api.github.com/repos/CoursePark/NestHydrationJS/issues/23","id":404204501,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDIwNDUwMQ==","user":{"login":"bvitale","id":631011,"node_id":"MDQ6VXNlcjYzMTAxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/631011?v=4","gravatar_id":"","url":"https://api.github.com/users/bvitale","html_url":"https://github.com/bvitale","followers_url":"https://api.github.com/users/bvitale/followers","following_url":"https://api.github.com/users/bvitale/following{/other_user}","gists_url":"https://api.github.com/users/bvitale/gists{/gist_id}","starred_url":"https://api.github.com/users/bvitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvitale/subscriptions","organizations_url":"https://api.github.com/users/bvitale/orgs","repos_url":"https://api.github.com/users/bvitale/repos","events_url":"https://api.github.com/users/bvitale/events{/privacy}","received_events_url":"https://api.github.com/users/bvitale/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T15:08:39Z","updated_at":"2018-07-11T15:08:39Z","author_association":"NONE","body":"You can disregard. Realized I didn't have an ID column to correlate the 1:1 relationship (for the nested objects) against. Thanks!"}}
{"actor":{"display_login":"bvitale"}}