{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/is/pulls/comments/185388845","pull_request_review_id":116765857,"id":185388845,"diff_hunk":"@@ -241,27 +236,27 @@ namespace is { // tslint:disable-line:no-namespace\n \t\t'nodeValue'\n \t];\n \n-\texport const domElement = (value: any) => object(value) && value.nodeType === NODE_TYPE_ELEMENT && string(value.nodeName) &&\n+\texport const domElement = (value: object & { nodeType: 1; nodeName: string }) => object(value) && value.nodeType === NODE_TYPE_ELEMENT && string(value.nodeName) &&\n \t\t!plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);\n \n-\texport const nodeStream = (value: any) => !nullOrUndefined(value) && isObject(value) && function_(value.pipe);\n+\texport const nodeStream = (value: object & { pipe: Function }) => !nullOrUndefined(value) && isObject(value) && function_(value.pipe);\n \n-\texport const infinite = (value: any) => value === Infinity || value === -Infinity;\n+\texport const infinite = (value: number) => value === Infinity || value === -Infinity;\n \n \tconst isAbsoluteMod2 = (value: number) => (rem: number) => integer(rem) && Math.abs(rem % 2) === value;\n \texport const even = isAbsoluteMod2(0);\n \texport const odd = isAbsoluteMod2(1);\n \n-\tconst isWhiteSpaceString = (value: any) => string(value) && /\\S/.test(value) === false;\n-\tconst isEmptyStringOrArray = (value: any) => (string(value) || array(value)) && value.length === 0;\n+\tconst isWhiteSpaceString = (value: string) => string(value) && /\\S/.test(value) === false;\n+\tconst isEmptyStringOrArray = (value: string | any[]) => (string(value) || array(value)) && value.length === 0;\n \tconst isEmptyObject = (value: any) => !map(value) && !set(value) && object(value) && Object.keys(value).length === 0;","path":"source/index.ts","position":184,"original_position":184,"commit_id":"2fbc25fcd5220b84993ca3134993c3d774168738","original_commit_id":"2fbc25fcd5220b84993ca3134993c3d774168738","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars1.githubusercontent.com/u/170270?v=4","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"body":"`any` => `object`?","created_at":"2018-05-02T04:02:32Z","updated_at":"2018-05-02T04:02:32Z","html_url":"https://github.com/sindresorhus/is/pull/49#discussion_r185388845","pull_request_url":"https://api.github.com/repos/sindresorhus/is/pulls/49","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/is/pulls/comments/185388845"},"html":{"href":"https://github.com/sindresorhus/is/pull/49#discussion_r185388845"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/is/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/is/pulls/49","id":184846262,"html_url":"https://github.com/sindresorhus/is/pull/49","diff_url":"https://github.com/sindresorhus/is/pull/49.diff","patch_url":"https://github.com/sindresorhus/is/pull/49.patch","issue_url":"https://api.github.com/repos/sindresorhus/is/issues/49","number":49,"state":"open","locked":false,"title":" Improve TS code by adding generics and removing `any` where applicable","user":{"login":"ltetzlaff","id":8214559,"avatar_url":"https://avatars3.githubusercontent.com/u/8214559?v=4","gravatar_id":"","url":"https://api.github.com/users/ltetzlaff","html_url":"https://github.com/ltetzlaff","followers_url":"https://api.github.com/users/ltetzlaff/followers","following_url":"https://api.github.com/users/ltetzlaff/following{/other_user}","gists_url":"https://api.github.com/users/ltetzlaff/gists{/gist_id}","starred_url":"https://api.github.com/users/ltetzlaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltetzlaff/subscriptions","organizations_url":"https://api.github.com/users/ltetzlaff/orgs","repos_url":"https://api.github.com/users/ltetzlaff/repos","events_url":"https://api.github.com/users/ltetzlaff/events{/privacy}","received_events_url":"https://api.github.com/users/ltetzlaff/received_events","type":"User","site_admin":false},"body":"This is in response to: https://github.com/sindresorhus/ow/pull/68#issuecomment-385262882\r\n\r\nThe switch at the top is debatable but should be faster and is also shorter 🙆\r\nGenerally it is more an improvement for TS-users and we directly see if our typings are not set correctly, as to be seen in the tests for instance 🕵️\r\n(If you're also interested why `() => {}` is ArrayLike (=== has a length) check this out: [Function.length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length))\r\n\r\nPlease bear with me for throwing plenty of those `any`s in in the first place: [Blame](https://github.com/sindresorhus/is/blame/master/source/index.ts) 🙈🙉\r\n\r\n","created_at":"2018-04-29T17:57:26Z","updated_at":"2018-05-02T04:02:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"feab997cba249364e0abb0649926f1e9c0e46c32","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/is/pulls/49/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/is/pulls/49/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/is/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/is/issues/49/comments","statuses_url":"https://api.github.com/repos/sindresorhus/is/statuses/2fbc25fcd5220b84993ca3134993c3d774168738","head":{"label":"ltetzlaff:master","ref":"master","sha":"2fbc25fcd5220b84993ca3134993c3d774168738","user":{"login":"ltetzlaff","id":8214559,"avatar_url":"https://avatars3.githubusercontent.com/u/8214559?v=4","gravatar_id":"","url":"https://api.github.com/users/ltetzlaff","html_url":"https://github.com/ltetzlaff","followers_url":"https://api.github.com/users/ltetzlaff/followers","following_url":"https://api.github.com/users/ltetzlaff/following{/other_user}","gists_url":"https://api.github.com/users/ltetzlaff/gists{/gist_id}","starred_url":"https://api.github.com/users/ltetzlaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltetzlaff/subscriptions","organizations_url":"https://api.github.com/users/ltetzlaff/orgs","repos_url":"https://api.github.com/users/ltetzlaff/repos","events_url":"https://api.github.com/users/ltetzlaff/events{/privacy}","received_events_url":"https://api.github.com/users/ltetzlaff/received_events","type":"User","site_admin":false},"repo":{"id":131515983,"name":"is","full_name":"ltetzlaff/is","owner":{"login":"ltetzlaff","id":8214559,"avatar_url":"https://avatars3.githubusercontent.com/u/8214559?v=4","gravatar_id":"","url":"https://api.github.com/users/ltetzlaff","html_url":"https://github.com/ltetzlaff","followers_url":"https://api.github.com/users/ltetzlaff/followers","following_url":"https://api.github.com/users/ltetzlaff/following{/other_user}","gists_url":"https://api.github.com/users/ltetzlaff/gists{/gist_id}","starred_url":"https://api.github.com/users/ltetzlaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltetzlaff/subscriptions","organizations_url":"https://api.github.com/users/ltetzlaff/orgs","repos_url":"https://api.github.com/users/ltetzlaff/repos","events_url":"https://api.github.com/users/ltetzlaff/events{/privacy}","received_events_url":"https://api.github.com/users/ltetzlaff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ltetzlaff/is","description":"Type check values: `is.string('🦄') //=> true`","fork":true,"url":"https://api.github.com/repos/ltetzlaff/is","forks_url":"https://api.github.com/repos/ltetzlaff/is/forks","keys_url":"https://api.github.com/repos/ltetzlaff/is/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ltetzlaff/is/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ltetzlaff/is/teams","hooks_url":"https://api.github.com/repos/ltetzlaff/is/hooks","issue_events_url":"https://api.github.com/repos/ltetzlaff/is/issues/events{/number}","events_url":"https://api.github.com/repos/ltetzlaff/is/events","assignees_url":"https://api.github.com/repos/ltetzlaff/is/assignees{/user}","branches_url":"https://api.github.com/repos/ltetzlaff/is/branches{/branch}","tags_url":"https://api.github.com/repos/ltetzlaff/is/tags","blobs_url":"https://api.github.com/repos/ltetzlaff/is/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ltetzlaff/is/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ltetzlaff/is/git/refs{/sha}","trees_url":"https://api.github.com/repos/ltetzlaff/is/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ltetzlaff/is/statuses/{sha}","languages_url":"https://api.github.com/repos/ltetzlaff/is/languages","stargazers_url":"https://api.github.com/repos/ltetzlaff/is/stargazers","contributors_url":"https://api.github.com/repos/ltetzlaff/is/contributors","subscribers_url":"https://api.github.com/repos/ltetzlaff/is/subscribers","subscription_url":"https://api.github.com/repos/ltetzlaff/is/subscription","commits_url":"https://api.github.com/repos/ltetzlaff/is/commits{/sha}","git_commits_url":"https://api.github.com/repos/ltetzlaff/is/git/commits{/sha}","comments_url":"https://api.github.com/repos/ltetzlaff/is/comments{/number}","issue_comment_url":"https://api.github.com/repos/ltetzlaff/is/issues/comments{/number}","contents_url":"https://api.github.com/repos/ltetzlaff/is/contents/{+path}","compare_url":"https://api.github.com/repos/ltetzlaff/is/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ltetzlaff/is/merges","archive_url":"https://api.github.com/repos/ltetzlaff/is/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ltetzlaff/is/downloads","issues_url":"https://api.github.com/repos/ltetzlaff/is/issues{/number}","pulls_url":"https://api.github.com/repos/ltetzlaff/is/pulls{/number}","milestones_url":"https://api.github.com/repos/ltetzlaff/is/milestones{/number}","notifications_url":"https://api.github.com/repos/ltetzlaff/is/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ltetzlaff/is/labels{/name}","releases_url":"https://api.github.com/repos/ltetzlaff/is/releases{/id}","deployments_url":"https://api.github.com/repos/ltetzlaff/is/deployments","created_at":"2018-04-29T17:43:45Z","updated_at":"2018-04-29T18:40:17Z","pushed_at":"2018-04-29T18:40:16Z","git_url":"git://github.com/ltetzlaff/is.git","ssh_url":"git@github.com:ltetzlaff/is.git","clone_url":"https://github.com/ltetzlaff/is.git","svn_url":"https://github.com/ltetzlaff/is","homepage":null,"size":975,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sindresorhus:master","ref":"master","sha":"38df0cfb24d1383a86b9f3d6c37c0d0abc3e5108","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars1.githubusercontent.com/u/170270?v=4","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":104379939,"name":"is","full_name":"sindresorhus/is","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars1.githubusercontent.com/u/170270?v=4","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/is","description":"Type check values: `is.string('🦄') //=> true`","fork":false,"url":"https://api.github.com/repos/sindresorhus/is","forks_url":"https://api.github.com/repos/sindresorhus/is/forks","keys_url":"https://api.github.com/repos/sindresorhus/is/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/is/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/is/teams","hooks_url":"https://api.github.com/repos/sindresorhus/is/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/is/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/is/events","assignees_url":"https://api.github.com/repos/sindresorhus/is/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/is/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/is/tags","blobs_url":"https://api.github.com/repos/sindresorhus/is/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/is/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/is/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/is/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/is/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/is/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/is/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/is/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/is/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/is/subscription","commits_url":"https://api.github.com/repos/sindresorhus/is/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/is/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/is/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/is/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/is/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/is/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/is/merges","archive_url":"https://api.github.com/repos/sindresorhus/is/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/is/downloads","issues_url":"https://api.github.com/repos/sindresorhus/is/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/is/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/is/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/is/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/is/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/is/releases{/id}","deployments_url":"https://api.github.com/repos/sindresorhus/is/deployments","created_at":"2017-09-21T17:46:08Z","updated_at":"2018-05-01T05:13:07Z","pushed_at":"2018-04-29T18:40:17Z","git_url":"git://github.com/sindresorhus/is.git","ssh_url":"git@github.com:sindresorhus/is.git","clone_url":"https://github.com/sindresorhus/is.git","svn_url":"https://github.com/sindresorhus/is","homepage":null,"size":976,"stargazers_count":582,"watchers_count":582,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":35,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":35,"open_issues":3,"watchers":582,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/is/pulls/49"},"html":{"href":"https://github.com/sindresorhus/is/pull/49"},"issue":{"href":"https://api.github.com/repos/sindresorhus/is/issues/49"},"comments":{"href":"https://api.github.com/repos/sindresorhus/is/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/is/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/is/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/is/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/is/statuses/2fbc25fcd5220b84993ca3134993c3d774168738"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sindresorhus"}}