{"action":"created","issue":{"url":"https://api.github.com/repos/wankdanker/node-object-mapper/issues/22","labels_url":"https://api.github.com/repos/wankdanker/node-object-mapper/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/wankdanker/node-object-mapper/issues/22/comments","events_url":"https://api.github.com/repos/wankdanker/node-object-mapper/issues/22/events","html_url":"https://github.com/wankdanker/node-object-mapper/pull/22","id":119532481,"number":22,"title":"Allow appending to existing arrays, force explicit null value allow for mapping from keys with null value.","user":{"login":"ccelson","id":5117190,"avatar_url":"https://avatars.githubusercontent.com/u/5117190?v=3","gravatar_id":"","url":"https://api.github.com/users/ccelson","html_url":"https://github.com/ccelson","followers_url":"https://api.github.com/users/ccelson/followers","following_url":"https://api.github.com/users/ccelson/following{/other_user}","gists_url":"https://api.github.com/users/ccelson/gists{/gist_id}","starred_url":"https://api.github.com/users/ccelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccelson/subscriptions","organizations_url":"https://api.github.com/users/ccelson/orgs","repos_url":"https://api.github.com/users/ccelson/repos","events_url":"https://api.github.com/users/ccelson/events{/privacy}","received_events_url":"https://api.github.com/users/ccelson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-30T16:49:27Z","updated_at":"2015-12-01T19:12:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wankdanker/node-object-mapper/pulls/22","html_url":"https://github.com/wankdanker/node-object-mapper/pull/22","diff_url":"https://github.com/wankdanker/node-object-mapper/pull/22.diff","patch_url":"https://github.com/wankdanker/node-object-mapper/pull/22.patch"},"body":"I'm not sure if this is too specific to our use case, but we found that it was tricky when we wanted to push items onto a newly mapped array, we would constantly be writing over the initial transform. This change allows you to specify \r\n\r\n```javascript\r\nsource[]:{\r\n  key:'destination[]+',\r\n  transform: (val)=> mappingFunction(val)\r\n},\r\nsomeOtherSource[]:{\r\n  key:'destination[]+',\r\n  transform: (val)=> mappingFunction(val)\r\n}\r\n\r\noutputs\r\n\r\n{\r\n  destination:[\r\n    {/*mappedObject from mappingFunction*/},\r\n    {/*other mappedObject from the mappingFunction*/}\r\n  ]\r\n}\r\n```\r\nWhich would then append the value to the existing array.\r\n\r\nWe also wanted to minimize the footprint of our transformation, so we wanted null values to be excluded in the mapping, unless explicitly specified with an postfix like opertator\r\n\r\n```javascript\r\nvar sourceObject = {\r\n  source:null,\r\n  source2:null\r\n},\r\nmappingObject = {\r\n  source:destinationMapNullValues?,\r\n  source2:desinationDoNotMapNull\r\n};\r\n\r\nThe result of the transform is\r\n{\r\n  destinationMapNullValues:null\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/wankdanker/node-object-mapper/issues/comments/161066113","html_url":"https://github.com/wankdanker/node-object-mapper/pull/22#issuecomment-161066113","issue_url":"https://api.github.com/repos/wankdanker/node-object-mapper/issues/22","id":161066113,"user":{"login":"ccelson","id":5117190,"avatar_url":"https://avatars.githubusercontent.com/u/5117190?v=3","gravatar_id":"","url":"https://api.github.com/users/ccelson","html_url":"https://github.com/ccelson","followers_url":"https://api.github.com/users/ccelson/followers","following_url":"https://api.github.com/users/ccelson/following{/other_user}","gists_url":"https://api.github.com/users/ccelson/gists{/gist_id}","starred_url":"https://api.github.com/users/ccelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccelson/subscriptions","organizations_url":"https://api.github.com/users/ccelson/orgs","repos_url":"https://api.github.com/users/ccelson/repos","events_url":"https://api.github.com/users/ccelson/events{/privacy}","received_events_url":"https://api.github.com/users/ccelson/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T19:12:57Z","updated_at":"2015-12-01T19:12:57Z","body":"That could work fine, I believe we'd only need to change the regex right?\r\nto this instead /(\\[\\]|\\[\\+\\])$/g   ? I could do that if thats the route you want to go. I see your point"}}