{"action":"closed","number":251,"pull_request":{"url":"https://api.github.com/repos/pelias/api/pulls/251","id":44935149,"html_url":"https://github.com/pelias/api/pull/251","diff_url":"https://github.com/pelias/api/pull/251.diff","patch_url":"https://github.com/pelias/api/pull/251.patch","issue_url":"https://api.github.com/repos/pelias/api/issues/251","number":251,"state":"closed","locked":false,"title":"refactor sanitizers: first pass","user":{"login":"missinglink","id":738069,"avatar_url":"https://avatars.githubusercontent.com/u/738069?v=3","gravatar_id":"","url":"https://api.github.com/users/missinglink","html_url":"https://github.com/missinglink","followers_url":"https://api.github.com/users/missinglink/followers","following_url":"https://api.github.com/users/missinglink/following{/other_user}","gists_url":"https://api.github.com/users/missinglink/gists{/gist_id}","starred_url":"https://api.github.com/users/missinglink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missinglink/subscriptions","organizations_url":"https://api.github.com/users/missinglink/orgs","repos_url":"https://api.github.com/users/missinglink/repos","events_url":"https://api.github.com/users/missinglink/events{/privacy}","received_events_url":"https://api.github.com/users/missinglink/received_events","type":"User","site_admin":false},"body":"first pass of a structural refactor that will allow the second stage work to be completed.\r\n\r\nin this PR:\r\n- deprecate `is-object` module in favour of `check-types` (and refactor type-checking code for clarity)\r\n- refactor all the sanitizers to return an object of `messages = { errors: [], warnings: [] }`\r\n- refactor all sanitizer method signatures to be `function( unclean, clean )`\r\n- clean up constants and move single-execution functions to a single-execution scope\r\n- minimal changes made to test suite in order to ensure backwards compatibility\r\n\r\nin the next PR:\r\n- remove implementation specific code from sanitizers, eg. the string for `unclean['point.lat']` should be defined outside the sanitizer itself, so it can be re-used and does not need to be aware of `expressjs` and things like `req.query` (almost complete).\r\n- update response body to include a more comprehensive list of `errors` and `warnings` (at this stage it is backwards compatible and only reports the 1st error message).\r\n- many more unit tests, much of this work was done without causing any tests to fail, this is due to most of the sanitizers not actually having any unit tests written at all!\r\n\r\nI will branch the rest of the work from here so this can be merged while that is ongoing","created_at":"2015-09-14T14:17:31Z","updated_at":"2015-09-14T16:02:04Z","closed_at":"2015-09-14T16:02:04Z","merged_at":"2015-09-14T16:02:04Z","merge_commit_sha":"a86547ab2307c35668166d964c36dbd998b523d0","assignee":{"login":"missinglink","id":738069,"avatar_url":"https://avatars.githubusercontent.com/u/738069?v=3","gravatar_id":"","url":"https://api.github.com/users/missinglink","html_url":"https://github.com/missinglink","followers_url":"https://api.github.com/users/missinglink/followers","following_url":"https://api.github.com/users/missinglink/following{/other_user}","gists_url":"https://api.github.com/users/missinglink/gists{/gist_id}","starred_url":"https://api.github.com/users/missinglink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missinglink/subscriptions","organizations_url":"https://api.github.com/users/missinglink/orgs","repos_url":"https://api.github.com/users/missinglink/repos","events_url":"https://api.github.com/users/missinglink/events{/privacy}","received_events_url":"https://api.github.com/users/missinglink/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pelias/api/pulls/251/commits","review_comments_url":"https://api.github.com/repos/pelias/api/pulls/251/comments","review_comment_url":"https://api.github.com/repos/pelias/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pelias/api/issues/251/comments","statuses_url":"https://api.github.com/repos/pelias/api/statuses/10242a8682ddb1e8d4315ca0e2cbe1af55b2cf96","head":{"label":"pelias:sanitizers","ref":"sanitizers","sha":"10242a8682ddb1e8d4315ca0e2cbe1af55b2cf96","user":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":23627382,"name":"api","full_name":"pelias/api","owner":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pelias/api","description":"HTTP API for Pelias Geocoder","fork":false,"url":"https://api.github.com/repos/pelias/api","forks_url":"https://api.github.com/repos/pelias/api/forks","keys_url":"https://api.github.com/repos/pelias/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/api/teams","hooks_url":"https://api.github.com/repos/pelias/api/hooks","issue_events_url":"https://api.github.com/repos/pelias/api/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/api/events","assignees_url":"https://api.github.com/repos/pelias/api/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/api/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/api/tags","blobs_url":"https://api.github.com/repos/pelias/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/api/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/api/languages","stargazers_url":"https://api.github.com/repos/pelias/api/stargazers","contributors_url":"https://api.github.com/repos/pelias/api/contributors","subscribers_url":"https://api.github.com/repos/pelias/api/subscribers","subscription_url":"https://api.github.com/repos/pelias/api/subscription","commits_url":"https://api.github.com/repos/pelias/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/api/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/api/merges","archive_url":"https://api.github.com/repos/pelias/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/api/downloads","issues_url":"https://api.github.com/repos/pelias/api/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/api/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/api/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/api/labels{/name}","releases_url":"https://api.github.com/repos/pelias/api/releases{/id}","created_at":"2014-09-03T16:06:04Z","updated_at":"2015-08-27T19:37:55Z","pushed_at":"2015-09-14T16:02:04Z","git_url":"git://github.com/pelias/api.git","ssh_url":"git@github.com:pelias/api.git","clone_url":"https://github.com/pelias/api.git","svn_url":"https://github.com/pelias/api","homepage":"","size":2521,"stargazers_count":26,"watchers_count":26,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":69,"forks":11,"open_issues":69,"watchers":26,"default_branch":"master"}},"base":{"label":"pelias:master","ref":"master","sha":"df40e34ad5a9e8d9cd5fe241fd664b792db6c7eb","user":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"repo":{"id":23627382,"name":"api","full_name":"pelias/api","owner":{"login":"pelias","id":8240367,"avatar_url":"https://avatars.githubusercontent.com/u/8240367?v=3","gravatar_id":"","url":"https://api.github.com/users/pelias","html_url":"https://github.com/pelias","followers_url":"https://api.github.com/users/pelias/followers","following_url":"https://api.github.com/users/pelias/following{/other_user}","gists_url":"https://api.github.com/users/pelias/gists{/gist_id}","starred_url":"https://api.github.com/users/pelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelias/subscriptions","organizations_url":"https://api.github.com/users/pelias/orgs","repos_url":"https://api.github.com/users/pelias/repos","events_url":"https://api.github.com/users/pelias/events{/privacy}","received_events_url":"https://api.github.com/users/pelias/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pelias/api","description":"HTTP API for Pelias Geocoder","fork":false,"url":"https://api.github.com/repos/pelias/api","forks_url":"https://api.github.com/repos/pelias/api/forks","keys_url":"https://api.github.com/repos/pelias/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pelias/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pelias/api/teams","hooks_url":"https://api.github.com/repos/pelias/api/hooks","issue_events_url":"https://api.github.com/repos/pelias/api/issues/events{/number}","events_url":"https://api.github.com/repos/pelias/api/events","assignees_url":"https://api.github.com/repos/pelias/api/assignees{/user}","branches_url":"https://api.github.com/repos/pelias/api/branches{/branch}","tags_url":"https://api.github.com/repos/pelias/api/tags","blobs_url":"https://api.github.com/repos/pelias/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pelias/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pelias/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/pelias/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pelias/api/statuses/{sha}","languages_url":"https://api.github.com/repos/pelias/api/languages","stargazers_url":"https://api.github.com/repos/pelias/api/stargazers","contributors_url":"https://api.github.com/repos/pelias/api/contributors","subscribers_url":"https://api.github.com/repos/pelias/api/subscribers","subscription_url":"https://api.github.com/repos/pelias/api/subscription","commits_url":"https://api.github.com/repos/pelias/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/pelias/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/pelias/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/pelias/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/pelias/api/contents/{+path}","compare_url":"https://api.github.com/repos/pelias/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pelias/api/merges","archive_url":"https://api.github.com/repos/pelias/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pelias/api/downloads","issues_url":"https://api.github.com/repos/pelias/api/issues{/number}","pulls_url":"https://api.github.com/repos/pelias/api/pulls{/number}","milestones_url":"https://api.github.com/repos/pelias/api/milestones{/number}","notifications_url":"https://api.github.com/repos/pelias/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pelias/api/labels{/name}","releases_url":"https://api.github.com/repos/pelias/api/releases{/id}","created_at":"2014-09-03T16:06:04Z","updated_at":"2015-08-27T19:37:55Z","pushed_at":"2015-09-14T16:02:04Z","git_url":"git://github.com/pelias/api.git","ssh_url":"git@github.com:pelias/api.git","clone_url":"https://github.com/pelias/api.git","svn_url":"https://github.com/pelias/api","homepage":"","size":2521,"stargazers_count":26,"watchers_count":26,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":69,"forks":11,"open_issues":69,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pelias/api/pulls/251"},"html":{"href":"https://github.com/pelias/api/pull/251"},"issue":{"href":"https://api.github.com/repos/pelias/api/issues/251"},"comments":{"href":"https://api.github.com/repos/pelias/api/issues/251/comments"},"review_comments":{"href":"https://api.github.com/repos/pelias/api/pulls/251/comments"},"review_comment":{"href":"https://api.github.com/repos/pelias/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pelias/api/pulls/251/commits"},"statuses":{"href":"https://api.github.com/repos/pelias/api/statuses/10242a8682ddb1e8d4315ca0e2cbe1af55b2cf96"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"missinglink","id":738069,"avatar_url":"https://avatars.githubusercontent.com/u/738069?v=3","gravatar_id":"","url":"https://api.github.com/users/missinglink","html_url":"https://github.com/missinglink","followers_url":"https://api.github.com/users/missinglink/followers","following_url":"https://api.github.com/users/missinglink/following{/other_user}","gists_url":"https://api.github.com/users/missinglink/gists{/gist_id}","starred_url":"https://api.github.com/users/missinglink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/missinglink/subscriptions","organizations_url":"https://api.github.com/users/missinglink/orgs","repos_url":"https://api.github.com/users/missinglink/repos","events_url":"https://api.github.com/users/missinglink/events{/privacy}","received_events_url":"https://api.github.com/users/missinglink/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":4,"additions":321,"deletions":315,"changed_files":18}}