{"id":18277631,"url":"https://github.com/inspect-js/is-callable","last_synced_at":"2025-04-05T11:10:45.504Z","repository":{"id":26559045,"uuid":"30012910","full_name":"inspect-js/is-callable","owner":"inspect-js","description":"Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag.","archived":false,"fork":false,"pushed_at":"2022-11-01T22:01:39.000Z","size":333,"stargazers_count":41,"open_issues_count":3,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T10:08:47.440Z","etag":null,"topics":["callable","ecmascript","function","functions","is-callable","javascript"],"latest_commit_sha":null,"homepage":"","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/inspect-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/deep-equal","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2015-01-29T09:24:15.000Z","updated_at":"2024-05-17T16:42:58.000Z","dependencies_parsed_at":"2023-01-14T04:55:42.447Z","dependency_job_id":null,"html_url":"https://github.com/inspect-js/is-callable","commit_stats":null,"previous_names":["ljharb/is-callable"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspect-js%2Fis-callable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspect-js%2Fis-callable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspect-js%2Fis-callable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspect-js%2Fis-callable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inspect-js","download_url":"https://codeload.github.com/inspect-js/is-callable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["callable","ecmascript","function","functions","is-callable","javascript"],"created_at":"2024-11-05T12:19:48.548Z","updated_at":"2025-04-05T11:10:45.476Z","avatar_url":"https://github.com/inspect-js.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://tidelift.com/funding/github/npm/deep-equal"],"categories":[],"sub_categories":[],"readme":"# is-callable \u003csup\u003e[![Version Badge][2]][1]\u003c/sup\u003e\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][5]][6]\n[![dev dependency status][7]][8]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][11]][1]\n\nIs this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag.\n\n## Supported engines\nAutomatically tested in every minor version of node.\n\nManually tested in:\n - Safari: v4 - v15 \u003csub\u003e(4, 5, 5.1, 6.0.5, 6.2, 7.1, 8, 9.1.3, 10.1.2, 11.1.2, 12.1, 13.1.2, 14.1.2, 15.3, 15.6.1)\u003c/sub\u003e\n   - Note: Safari 9 has `class`, but `Function.prototype.toString` hides that progeny and makes them look like functions, so `class` constructors will be reported by this package as callable, when they are not in fact callable.\n - Chrome: v15 - v81, v83 - v106\u003csub\u003e(every integer version)\u003c/sub\u003e\n   - Note: This includes Edge v80+ and Opera v15+, which matches Chrome\n - Firefox: v3, v3.6, v4 - v105 \u003csub\u003e(every integer version)\u003c/sub\u003e\n   - Note: v45 - v54 has `class`, but `Function.prototype.toString` hides that progeny and makes them look like functions, so `class` constructors will be reported by this package as callable, when they are not in fact callable.\n   - Note: in v42 - v63, `Function.prototype.toString` throws on HTML element constructors, or a Proxy to a function\n   - Note: in v20 - v35, HTML element constructors are not callable, despite having typeof `function`.\n   - Note: in v19, `document.all` is not callable.\n - IE: v6 - v11\u003csub\u003e(every integer version\u003c/sub\u003e\n - Opera: v11.1, v11.5, v11.6, v12.1, v12.14, v12.15, v12.16, v15+ \u003csub\u003ev15+ matches Chrome\u003c/sub\u003e\n\n## Example\n\n```js\nvar isCallable = require('is-callable');\nvar assert = require('assert');\n\nassert.notOk(isCallable(undefined));\nassert.notOk(isCallable(null));\nassert.notOk(isCallable(false));\nassert.notOk(isCallable(true));\nassert.notOk(isCallable([]));\nassert.notOk(isCallable({}));\nassert.notOk(isCallable(/a/g));\nassert.notOk(isCallable(new RegExp('a', 'g')));\nassert.notOk(isCallable(new Date()));\nassert.notOk(isCallable(42));\nassert.notOk(isCallable(NaN));\nassert.notOk(isCallable(Infinity));\nassert.notOk(isCallable(new Number(42)));\nassert.notOk(isCallable('foo'));\nassert.notOk(isCallable(Object('foo')));\n\nassert.ok(isCallable(function () {}));\nassert.ok(isCallable(function* () {}));\nassert.ok(isCallable(x =\u003e x * x));\n```\n\n## Install\n\nInstall with\n\n```\nnpm install is-callable\n```\n\n## Tests\n\nSimply clone the repo, `npm install`, and run `npm test`\n\n[1]: https://npmjs.org/package/is-callable\n[2]: https://versionbadg.es/inspect-js/is-callable.svg\n[5]: https://david-dm.org/inspect-js/is-callable.svg\n[6]: https://david-dm.org/inspect-js/is-callable\n[7]: https://david-dm.org/inspect-js/is-callable/dev-status.svg\n[8]: https://david-dm.org/inspect-js/is-callable#info=devDependencies\n[11]: https://nodei.co/npm/is-callable.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/is-callable.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/is-callable.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=is-callable\n[codecov-image]: https://codecov.io/gh/inspect-js/is-callable/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/inspect-js/is-callable/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-callable\n[actions-url]: https://github.com/inspect-js/is-callable/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspect-js%2Fis-callable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finspect-js%2Fis-callable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspect-js%2Fis-callable/lists"}