GitHub PullRequestEvent at 2014-04-30 10:29:55
Repository: node-accessors
Actor: andyburke
Payload: {"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/ttaubert/node-accessors/pulls/1","id":15335459,"html_url":"https://github.com/ttaubert/node-accessors/pull/1","diff_url":"https://github.com/ttaubert/node-accessors/pull/1.diff","patch_url":"https://github.com/ttaubert/node-accessors/pull/1.patch","issue_url":"https://api.github.com/repos/ttaubert/node-accessors/issues/1","number":1,"state":"open","title":"Add array access in addition to appending.","user":{"login":"andyburke","id":273857,"avatar_url":"https://avatars.githubusercontent.com/u/273857?","gravatar_id":"2d037f6a385d2514813417119d1be6f9","url":"https://api.github.com/users/andyburke","html_url":"https://github.com/andyburke","followers_url":"https://api.github.com/users/andyburke/followers","following_url":"https://api.github.com/users/andyburke/following{/other_user}","gists_url":"https://api.github.com/users/andyburke/gists{/gist_id}","starred_url":"https://api.github.com/users/andyburke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyburke/subscriptions","organizations_url":"https://api.github.com/users/andyburke/orgs","repos_url":"https://api.github.com/users/andyburke/repos","events_url":"https://api.github.com/users/andyburke/events{/privacy}","received_events_url":"https://api.github.com/users/andyburke/received_events","type":"User","site_admin":false},"body":"This adds the ability to access arrays in addition to the ability to append to them. It allows both reading an writing into arrays as one might expect.\r\n\r\nIt also changes the set/get methods to be on the Accessors function and makes the Accessor.prototype.set/get into wrappers for those. This should cut down on unnecessary allocations of new Accessor objects. In the previous implementation, every Accessor.get(...) or Accessor.set(...) call would end up allocating and then releasing an Accessor object. Now that allocation will only happen if they explicitly call Accessor(obj).\r\n\r\nI made these changes because I need to be able to access array elements, eg:\r\n\r\n```javascript\r\n  // before:\r\n  // foo: {\r\n  //   bar: [\r\n  //     { baz: 'lemur' },\r\n  //     { baz: 'sloth' },\r\n  //     { baz: 'seal' }\r\n  //  ]\r\n  // }\r\n\r\n  Accessor.set( 'foo.bar[1].baz', 'yak' );\r\n\r\n  // after:\r\n  // foo: {\r\n  //   bar: [\r\n  //     { baz: 'lemur' },\r\n  //     { baz: 'yak' },\r\n  //     { baz: 'seal' }\r\n  //  ]\r\n  // }\r\n```\r\n\r\nOpen to discussion if you have issues with this PR that we can work through.","created_at":"2014-04-30T10:29:54Z","updated_at":"2014-04-30T10:29:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ttaubert/node-accessors/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ttaubert/node-accessors/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ttaubert/node-accessors/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ttaubert/node-accessors/issues/1/comments","statuses_url":"https://api.github.com/repos/ttaubert/node-accessors/statuses/ab10cf08e19a736334b603b2f7ce2f20afca3b6c","head":{"label":"andyburke:master","ref":"master","sha":"ab10cf08e19a736334b603b2f7ce2f20afca3b6c","user":{"login":"andyburke","id":273857,"avatar_url":"https://avatars.githubusercontent.com/u/273857?","gravatar_id":"2d037f6a385d2514813417119d1be6f9","url":"https://api.github.com/users/andyburke","html_url":"https://github.com/andyburke","followers_url":"https://api.github.com/users/andyburke/followers","following_url":"https://api.github.com/users/andyburke/following{/other_user}","gists_url":"https://api.github.com/users/andyburke/gists{/gist_id}","starred_url":"https://api.github.com/users/andyburke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyburke/subscriptions","organizations_url":"https://api.github.com/users/andyburke/orgs","repos_url":"https://api.github.com/users/andyburke/repos","events_url":"https://api.github.com/users/andyburke/events{/privacy}","received_events_url":"https://api.github.com/users/andyburke/received_events","type":"User","site_admin":false},"repo":{"id":19304652,"name":"node-accessors","full_name":"andyburke/node-accessors","owner":{"login":"andyburke","id":273857,"avatar_url":"https://avatars.githubusercontent.com/u/273857?","gravatar_id":"2d037f6a385d2514813417119d1be6f9","url":"https://api.github.com/users/andyburke","html_url":"https://github.com/andyburke","followers_url":"https://api.github.com/users/andyburke/followers","following_url":"https://api.github.com/users/andyburke/following{/other_user}","gists_url":"https://api.github.com/users/andyburke/gists{/gist_id}","starred_url":"https://api.github.com/users/andyburke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyburke/subscriptions","organizations_url":"https://api.github.com/users/andyburke/orgs","repos_url":"https://api.github.com/users/andyburke/repos","events_url":"https://api.github.com/users/andyburke/events{/privacy}","received_events_url":"https://api.github.com/users/andyburke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andyburke/node-accessors","description":"Read and update nested objects using simple patterns.","fork":true,"url":"https://api.github.com/repos/andyburke/node-accessors","forks_url":"https://api.github.com/repos/andyburke/node-accessors/forks","keys_url":"https://api.github.com/repos/andyburke/node-accessors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andyburke/node-accessors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andyburke/node-accessors/teams","hooks_url":"https://api.github.com/repos/andyburke/node-accessors/hooks","issue_events_url":"https://api.github.com/repos/andyburke/node-accessors/issues/events{/number}","events_url":"https://api.github.com/repos/andyburke/node-accessors/events","assignees_url":"https://api.github.com/repos/andyburke/node-accessors/assignees{/user}","branches_url":"https://api.github.com/repos/andyburke/node-accessors/branches{/branch}","tags_url":"https://api.github.com/repos/andyburke/node-accessors/tags","blobs_url":"https://api.github.com/repos/andyburke/node-accessors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andyburke/node-accessors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andyburke/node-accessors/git/refs{/sha}","trees_url":"https://api.github.com/repos/andyburke/node-accessors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andyburke/node-accessors/statuses/{sha}","languages_url":"https://api.github.com/repos/andyburke/node-accessors/languages","stargazers_url":"https://api.github.com/repos/andyburke/node-accessors/stargazers","contributors_url":"https://api.github.com/repos/andyburke/node-accessors/contributors","subscribers_url":"https://api.github.com/repos/andyburke/node-accessors/subscribers","subscription_url":"https://api.github.com/repos/andyburke/node-accessors/subscription","commits_url":"https://api.github.com/repos/andyburke/node-accessors/commits{/sha}","git_commits_url":"https://api.github.com/repos/andyburke/node-accessors/git/commits{/sha}","comments_url":"https://api.github.com/repos/andyburke/node-accessors/comments{/number}","issue_comment_url":"https://api.github.com/repos/andyburke/node-accessors/issues/comments/{number}","contents_url":"https://api.github.com/repos/andyburke/node-accessors/contents/{+path}","compare_url":"https://api.github.com/repos/andyburke/node-accessors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andyburke/node-accessors/merges","archive_url":"https://api.github.com/repos/andyburke/node-accessors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andyburke/node-accessors/downloads","issues_url":"https://api.github.com/repos/andyburke/node-accessors/issues{/number}","pulls_url":"https://api.github.com/repos/andyburke/node-accessors/pulls{/number}","milestones_url":"https://api.github.com/repos/andyburke/node-accessors/milestones{/number}","notifications_url":"https://api.github.com/repos/andyburke/node-accessors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andyburke/node-accessors/labels{/name}","releases_url":"https://api.github.com/repos/andyburke/node-accessors/releases{/id}","created_at":"2014-04-30T07:21:45Z","updated_at":"2014-04-30T10:29:54Z","pushed_at":"2014-04-30T10:23:21Z","git_url":"git://github.com/andyburke/node-accessors.git","ssh_url":"git@github.com:andyburke/node-accessors.git","clone_url":"https://github.com/andyburke/node-accessors.git","svn_url":"https://github.com/andyburke/node-accessors","homepage":null,"size":120,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ttaubert:master","ref":"master","sha":"c4f0a7085b1bf04358ff33433decece0a7bfc2d7","user":{"login":"ttaubert","id":300895,"avatar_url":"https://avatars.githubusercontent.com/u/300895?","gravatar_id":"6bab41d9b9453e984752a40a0dccbffc","url":"https://api.github.com/users/ttaubert","html_url":"https://github.com/ttaubert","followers_url":"https://api.github.com/users/ttaubert/followers","following_url":"https://api.github.com/users/ttaubert/following{/other_user}","gists_url":"https://api.github.com/users/ttaubert/gists{/gist_id}","starred_url":"https://api.github.com/users/ttaubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttaubert/subscriptions","organizations_url":"https://api.github.com/users/ttaubert/orgs","repos_url":"https://api.github.com/users/ttaubert/repos","events_url":"https://api.github.com/users/ttaubert/events{/privacy}","received_events_url":"https://api.github.com/users/ttaubert/received_events","type":"User","site_admin":false},"repo":{"id":13068412,"name":"node-accessors","full_name":"ttaubert/node-accessors","owner":{"login":"ttaubert","id":300895,"avatar_url":"https://avatars.githubusercontent.com/u/300895?","gravatar_id":"6bab41d9b9453e984752a40a0dccbffc","url":"https://api.github.com/users/ttaubert","html_url":"https://github.com/ttaubert","followers_url":"https://api.github.com/users/ttaubert/followers","following_url":"https://api.github.com/users/ttaubert/following{/other_user}","gists_url":"https://api.github.com/users/ttaubert/gists{/gist_id}","starred_url":"https://api.github.com/users/ttaubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttaubert/subscriptions","organizations_url":"https://api.github.com/users/ttaubert/orgs","repos_url":"https://api.github.com/users/ttaubert/repos","events_url":"https://api.github.com/users/ttaubert/events{/privacy}","received_events_url":"https://api.github.com/users/ttaubert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ttaubert/node-accessors","description":"Read and update nested objects using simple patterns.","fork":false,"url":"https://api.github.com/repos/ttaubert/node-accessors","forks_url":"https://api.github.com/repos/ttaubert/node-accessors/forks","keys_url":"https://api.github.com/repos/ttaubert/node-accessors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ttaubert/node-accessors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ttaubert/node-accessors/teams","hooks_url":"https://api.github.com/repos/ttaubert/node-accessors/hooks","issue_events_url":"https://api.github.com/repos/ttaubert/node-accessors/issues/events{/number}","events_url":"https://api.github.com/repos/ttaubert/node-accessors/events","assignees_url":"https://api.github.com/repos/ttaubert/node-accessors/assignees{/user}","branches_url":"https://api.github.com/repos/ttaubert/node-accessors/branches{/branch}","tags_url":"https://api.github.com/repos/ttaubert/node-accessors/tags","blobs_url":"https://api.github.com/repos/ttaubert/node-accessors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ttaubert/node-accessors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ttaubert/node-accessors/git/refs{/sha}","trees_url":"https://api.github.com/repos/ttaubert/node-accessors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ttaubert/node-accessors/statuses/{sha}","languages_url":"https://api.github.com/repos/ttaubert/node-accessors/languages","stargazers_url":"https://api.github.com/repos/ttaubert/node-accessors/stargazers","contributors_url":"https://api.github.com/repos/ttaubert/node-accessors/contributors","subscribers_url":"https://api.github.com/repos/ttaubert/node-accessors/subscribers","subscription_url":"https://api.github.com/repos/ttaubert/node-accessors/subscription","commits_url":"https://api.github.com/repos/ttaubert/node-accessors/commits{/sha}","git_commits_url":"https://api.github.com/repos/ttaubert/node-accessors/git/commits{/sha}","comments_url":"https://api.github.com/repos/ttaubert/node-accessors/comments{/number}","issue_comment_url":"https://api.github.com/repos/ttaubert/node-accessors/issues/comments/{number}","contents_url":"https://api.github.com/repos/ttaubert/node-accessors/contents/{+path}","compare_url":"https://api.github.com/repos/ttaubert/node-accessors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ttaubert/node-accessors/merges","archive_url":"https://api.github.com/repos/ttaubert/node-accessors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ttaubert/node-accessors/downloads","issues_url":"https://api.github.com/repos/ttaubert/node-accessors/issues{/number}","pulls_url":"https://api.github.com/repos/ttaubert/node-accessors/pulls{/number}","milestones_url":"https://api.github.com/repos/ttaubert/node-accessors/milestones{/number}","notifications_url":"https://api.github.com/repos/ttaubert/node-accessors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ttaubert/node-accessors/labels{/name}","releases_url":"https://api.github.com/repos/ttaubert/node-accessors/releases{/id}","created_at":"2013-09-24T15:19:37Z","updated_at":"2013-09-28T17:13:24Z","pushed_at":"2013-09-28T17:13:24Z","git_url":"git://github.com/ttaubert/node-accessors.git","ssh_url":"git@github.com:ttaubert/node-accessors.git","clone_url":"https://github.com/ttaubert/node-accessors.git","svn_url":"https://github.com/ttaubert/node-accessors","homepage":null,"size":120,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ttaubert/node-accessors/pulls/1"},"html":{"href":"https://github.com/ttaubert/node-accessors/pull/1"},"issue":{"href":"https://api.github.com/repos/ttaubert/node-accessors/issues/1"},"comments":{"href":"https://api.github.com/repos/ttaubert/node-accessors/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ttaubert/node-accessors/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ttaubert/node-accessors/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ttaubert/node-accessors/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ttaubert/node-accessors/statuses/ab10cf08e19a736334b603b2f7ce2f20afca3b6c"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":149,"deletions":76,"changed_files":3}}