{"id":19649124,"url":"https://github.com/toxic-johann/toxic-predicate-functions","last_synced_at":"2026-01-28T01:31:22.646Z","repository":{"id":57378440,"uuid":"95968212","full_name":"toxic-johann/toxic-predicate-functions","owner":"toxic-johann","description":"predicate functions collection","archived":false,"fork":false,"pushed_at":"2020-06-02T18:16:21.000Z","size":258,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T22:18:44.028Z","etag":null,"topics":["predicate-functions","utils"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toxic-johann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-01T14:13:49.000Z","updated_at":"2023-03-04T06:00:43.000Z","dependencies_parsed_at":"2022-09-26T16:41:32.176Z","dependency_job_id":null,"html_url":"https://github.com/toxic-johann/toxic-predicate-functions","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/toxic-johann/toxic-predicate-functions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxic-johann%2Ftoxic-predicate-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxic-johann%2Ftoxic-predicate-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxic-johann%2Ftoxic-predicate-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxic-johann%2Ftoxic-predicate-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toxic-johann","download_url":"https://codeload.github.com/toxic-johann/toxic-predicate-functions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxic-johann%2Ftoxic-predicate-functions/sbom","scorecard":{"id":895814,"data":{"date":"2025-08-11","repo":{"name":"github.com/toxic-johann/toxic-predicate-functions","commit":"2582eb5495952fd4c42aec012ce5b8d37c2cc4f6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T13:39:56.872Z","repository_id":57378440,"created_at":"2025-08-24T13:39:56.872Z","updated_at":"2025-08-24T13:39:56.872Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["predicate-functions","utils"],"created_at":"2024-11-11T14:51:39.766Z","updated_at":"2026-01-28T01:31:22.627Z","avatar_url":"https://github.com/toxic-johann.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toxic-predicate-functions\n\n[![Build Status](https://img.shields.io/travis/toxic-johann/toxic-predicate-functions/master.svg?style=flat-square)](https://travis-ci.org/toxic-johann/toxic-predicate-functions.svg?branch=master)\n[![Coverage Status](https://img.shields.io/coveralls/toxic-johann/toxic-predicate-functions/master.svg?style=flat-square)](https://coveralls.io/github/toxic-johann/toxic-predicate-functions?branch=master)\n[![npm](https://img.shields.io/npm/v/toxic-predicate-functions.svg?colorB=brightgreen\u0026style=flat-square)](https://www.npmjs.com/package/toxic-predicate-functions)\n[![dependency Status](https://david-dm.org/toxic-johann/toxic-predicate-functions.svg)](https://david-dm.org/toxic-johann/toxic-predicate-functions)\n[![devDependency Status](https://david-dm.org/toxic-johann/toxic-predicate-functions/dev-status.svg)](https://david-dm.org/toxic-johann/toxic-predicate-functions?type=dev) [![Greenkeeper badge](https://badges.greenkeeper.io/toxic-johann/toxic-predicate-functions.svg)](https://greenkeeper.io/)\n\npredicate functions collection\n\n## get started\n\n```shell\nnpm install toxic-predicate-functions --save\n```\n\nif you are using `flow`, you should import our flow defination, by adding this to your `.flowconfig`.\n\n```ya\n[ignore]\n\n[include]\n\n[libs]\n./node_modules/toxic-predicate-functions/lib/index.flow.js\n[options]\n\n[lints]\n```\n\n## doc\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### defined\n\n[src/index.js:5-7](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L5-L7 \"Source code on GitHub\")\n\nto check whether the object is defined or not\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isVoid\n\n[src/index.js:11-13](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L11-L13 \"Source code on GitHub\")\n\nis void element or not ? Means it will return true when val is undefined or null\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isArray\n\n[src/index.js:17-19](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L17-L19 \"Source code on GitHub\")\n\nto check whether a variable is array\n\n**Parameters**\n\n-   `arr` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isFunction\n\n[src/index.js:24-26](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L24-L26 \"Source code on GitHub\")\n\nis it a function or not\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isObject\n\n[src/index.js:31-34](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L31-L34 \"Source code on GitHub\")\n\nis it an object or not\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isNumber\n\n[src/index.js:38-40](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L38-L40 \"Source code on GitHub\")\n\nto tell you if it's a real number\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isNumeric\n\n[src/index.js:44-46](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L44-L46 \"Source code on GitHub\")\n\nto tell you if the val can be transfer into number\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isInteger\n\n[src/index.js:50-52](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L50-L52 \"Source code on GitHub\")\n\nis it an interget or not\n\n**Parameters**\n\n-   `num` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isEmpty\n\n[src/index.js:57-65](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L57-L65 \"Source code on GitHub\")\n\nreturn true when the value is \"\", {}, \\[], 0, null, undefined, false.\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isEvent\n\n[src/index.js:69-71](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L69-L71 \"Source code on GitHub\")\n\nis it an event or not\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isBlob\n\n[src/index.js:75-77](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L75-L77 \"Source code on GitHub\")\n\nis it a blob\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isFile\n\n[src/index.js:81-83](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L81-L83 \"Source code on GitHub\")\n\nis it a file uploaded by user through file inpue\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isDate\n\n[src/index.js:87-89](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L87-L89 \"Source code on GitHub\")\n\nis it a date\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isString\n\n[src/index.js:93-96](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L93-L96 \"Source code on GitHub\")\n\nis it a string\n\n**Parameters**\n\n-   `str` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isBoolean\n\n[src/index.js:100-102](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L100-L102 \"Source code on GitHub\")\n\nis Boolean or not\n\n**Parameters**\n\n-   `bool` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isPromise\n\n[src/index.js:106-108](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L106-L108 \"Source code on GitHub\")\n\nis a promise or not\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isPrimitive\n\n[src/index.js:112-114](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L112-L114 \"Source code on GitHub\")\n\nis Primitive type or not, whick means it will return true when data is number/string/boolean/undefined/null\n\n**Parameters**\n\n-   `val` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isUrl\n\n[src/index.js:118-120](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L118-L120 \"Source code on GitHub\")\n\nis it an url, but this test require the url to have an protocol\n\n**Parameters**\n\n-   `str` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isNode\n\n[src/index.js:124-131](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L124-L131 \"Source code on GitHub\")\n\nto test if a HTML node\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isElement\n\n[src/index.js:135-143](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L135-L143 \"Source code on GitHub\")\n\nto test if a HTML element\n\n**Parameters**\n\n-   `obj` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isChildNode\n\n[src/index.js:147-152](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L147-L152 \"Source code on GitHub\")\n\ncheck if node A is node B's parent or not\n\n**Parameters**\n\n-   `parent` **[Node](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling)** \n-   `child` **[Node](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling)** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isPosterityNode\n\n[src/index.js:156-167](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L156-L167 \"Source code on GitHub\")\n\ncheck if node B is node A's posterrity or not\n\n**Parameters**\n\n-   `parent` **[Node](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling)** \n-   `child` **[Node](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling)** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isHTMLString\n\n[src/index.js:171-173](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L171-L173 \"Source code on GitHub\")\n\ncheck if the string is an HTMLString\n\n**Parameters**\n\n-   `str` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isError\n\n[src/index.js:177-179](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L177-L179 \"Source code on GitHub\")\n\ncheck if is an error\n\n**Parameters**\n\n-   `val` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### isRegExp\n\n[src/index.js:183-185](https://github.com/toxic-johann/toxic-predicate-functions/blob/126adb1bdf2ab98826e10aa1b465209accb97197/src/index.js#L183-L185 \"Source code on GitHub\")\n\ncheck if is an RegExp\n\n**Parameters**\n\n-   `val` **any** \n\nReturns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxic-johann%2Ftoxic-predicate-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoxic-johann%2Ftoxic-predicate-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxic-johann%2Ftoxic-predicate-functions/lists"}