{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/2879","repository_url":"https://api.github.com/repos/lodash/lodash","labels_url":"https://api.github.com/repos/lodash/lodash/issues/2879/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/2879/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/2879/events","html_url":"https://github.com/lodash/lodash/issues/2879","id":194345173,"number":2879,"title":"[feature request] support Map and WeakMap in _.get & _.set & _.update","user":{"login":"SeregPie","id":1217953,"avatar_url":"https://avatars.githubusercontent.com/u/1217953?v=3","gravatar_id":"","url":"https://api.github.com/users/SeregPie","html_url":"https://github.com/SeregPie","followers_url":"https://api.github.com/users/SeregPie/followers","following_url":"https://api.github.com/users/SeregPie/following{/other_user}","gists_url":"https://api.github.com/users/SeregPie/gists{/gist_id}","starred_url":"https://api.github.com/users/SeregPie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeregPie/subscriptions","organizations_url":"https://api.github.com/users/SeregPie/orgs","repos_url":"https://api.github.com/users/SeregPie/repos","events_url":"https://api.github.com/users/SeregPie/events{/privacy}","received_events_url":"https://api.github.com/users/SeregPie/received_events","type":"User","site_admin":false},"labels":[{"id":2763154,"url":"https://api.github.com/repos/lodash/lodash/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-08T14:10:53Z","updated_at":"2016-12-13T22:06:21Z","closed_at":null,"body":"It would be a nice feature to have.\r\n```javascript\r\nlet a = {a: 11};\r\nlet b = {b: 22};\r\nlet map = new Map();\r\n_.setWith(map, [a, b], 'hi!', Map);\r\nconsole.log(map.get(a).get(b) === 'hi!'); // => true\r\n```"},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/266877041","html_url":"https://github.com/lodash/lodash/issues/2879#issuecomment-266877041","issue_url":"https://api.github.com/repos/lodash/lodash/issues/2879","id":266877041,"user":{"login":"SeregPie","id":1217953,"avatar_url":"https://avatars.githubusercontent.com/u/1217953?v=3","gravatar_id":"","url":"https://api.github.com/users/SeregPie","html_url":"https://github.com/SeregPie","followers_url":"https://api.github.com/users/SeregPie/followers","following_url":"https://api.github.com/users/SeregPie/following{/other_user}","gists_url":"https://api.github.com/users/SeregPie/gists{/gist_id}","starred_url":"https://api.github.com/users/SeregPie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeregPie/subscriptions","organizations_url":"https://api.github.com/users/SeregPie/orgs","repos_url":"https://api.github.com/users/SeregPie/repos","events_url":"https://api.github.com/users/SeregPie/events{/privacy}","received_events_url":"https://api.github.com/users/SeregPie/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T22:06:21Z","updated_at":"2016-12-13T22:06:21Z","body":"Hello. Didn't had much time. Just started right now to watch into source.\r\n\r\nThe 'read' functions are not a big deal... for Maps. For WeakMaps I'm missing a sort of `isPrimitive` function. Also I don't know how to handle a primitive key when current object is a WeakMap. Should it return default/undefined in this situation or handle the WeakMap as plain object and proceed with object[toKey(pathItem)]?\r\n\r\n```javascript\r\nfunction baseGet(object, path) {\r\n  path = castPath(path, object);\r\n\r\n  var index = 0,\r\n      length = path.length,\r\n      pathItem;\r\n\r\n  while (object != null && index < length) {\r\n    pathItem = path[index++];\r\n    object = baseIsMap(object)\r\n      ? object.get(pathItem)\r\n      : object[toKey(pathItem)];\r\n  }\r\n  return (index && index == length) ? object : undefined;\r\n}\r\n```\r\n\r\n```javascript\r\nfunction result(object, path, defaultValue) {\r\n  path = castPath(path, object);\r\n\r\n  var index = -1,\r\n      length = path.length;\r\n\r\n  // Ensure the loop is entered when path is empty.\r\n  if (!length) {\r\n    length = 1;\r\n    object = undefined;\r\n  }\r\n  while (++index < length) {\r\n    var value = object == null\r\n      ? undefined\r\n      : baseIsMap(object)\r\n          ? object.get(path[index])\r\n          : object[toKey(path[index])];\r\n    if (value === undefined) {\r\n      index = length;\r\n      value = defaultValue;\r\n    }\r\n    object = isFunction(value) ? value.call(object) : value;\r\n  }\r\n  return object;\r\n}\r\n```"}}
{"actor":{"display_login":"SeregPie"}}