{"id":16875943,"url":"https://github.com/evelynhathaway/bind-deep","last_synced_at":"2025-10-12T21:44:54.243Z","repository":{"id":33230017,"uuid":"155510370","full_name":"evelynhathaway/bind-deep","owner":"evelynhathaway","description":"📎🕳️  Lightweight module for binding a function or object deeply","archived":false,"fork":false,"pushed_at":"2022-08-20T21:16:58.000Z","size":2019,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T18:23:13.104Z","etag":null,"topics":["bind","bound-arguments","context","deep","function","hacktoberfest","nodejs","object","this","typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/bind-deep","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/evelynhathaway.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-10-31T06:36:07.000Z","updated_at":"2023-03-04T04:13:34.000Z","dependencies_parsed_at":"2022-09-01T13:52:40.131Z","dependency_job_id":null,"html_url":"https://github.com/evelynhathaway/bind-deep","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/evelynhathaway/bind-deep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evelynhathaway%2Fbind-deep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evelynhathaway%2Fbind-deep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evelynhathaway%2Fbind-deep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evelynhathaway%2Fbind-deep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evelynhathaway","download_url":"https://codeload.github.com/evelynhathaway/bind-deep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evelynhathaway%2Fbind-deep/sbom","scorecard":{"id":386032,"data":{"date":"2025-08-11","repo":{"name":"github.com/evelynhathaway/bind-deep","commit":"92dfcd32a728e0bdf714a705280bee07e4d778cf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Code-Review","score":0,"reason":"Found 0/3 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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"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":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/evelynhathaway/bind-deep/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/evelynhathaway/bind-deep/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/evelynhathaway/bind-deep/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/evelynhathaway/bind-deep/nodejs.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"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":"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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 29 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"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-f9xv-q969-pqx4"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T16:37:52.159Z","repository_id":33230017,"created_at":"2025-08-18T16:37:52.159Z","updated_at":"2025-08-18T16:37:52.159Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013126,"owners_count":26085232,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bind","bound-arguments","context","deep","function","hacktoberfest","nodejs","object","this","typescript"],"created_at":"2024-10-13T15:37:37.346Z","updated_at":"2025-10-12T21:44:54.224Z","avatar_url":"https://github.com/evelynhathaway.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg alt=\"Bind Deep icon\" width=\"128\" height=\"128\" align=\"center\" src=\".github/icon.png\"/\u003e\n\n# Bind Deep\n\n**Lightweight module for binding a function or object deeply**\n\n[![npm version](https://badgen.net/npm/v/bind-deep?icon=npm)](https://www.npmjs.com/package/bind-deep)\n[![check status](https://badgen.net/github/checks/evelynhathaway/bind-deep/main?icon=github)](https://github.com/evelynhathaway/bind-deep/actions)\n[![minified + gzip bundle size](https://badgen.net/bundlephobia/minzip/bind-deep)](https://bundlephobia.com/result?p=bind-deep)\n[![license: MIT](https://badgen.net/badge/license/MIT/blue)](/LICENSE)\n\n\u003c/div\u003e\n\n## Description\n\nBind an object to `this` in all methods in a function, object, or array. A simple, single-dependency (only for TypeScript types) alternative to [deep-bind](https://github.com/jonschlinkert/deep-bind).\n\n## Features\n\n- Binds the root function and all own, enumerable property functions including property accessors\n- Compatible with functions, arrays, objects, custom classes, and array-likes\n- Binds the `this` value and optionally, additional arguments just like [`func.bind()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind)\n- Copies objects and enumerable properties deeply\n- Preserves and copies prototypes for all types\n- **New in `v2.1.0`:** Strict TypeScript type definitions\n\n## Installation\n\n```bash\nnpm install bind-deep --save\n```\n\n---\n\n## Usage\n\n### `bindDeep(object, thisArg, [...args])`\n\n**Returns**: `Function` \\| `Object` \\| `Array` - The function or object passed as `object` but with\nitself and all methods bound to `thisArg`\n\n| Parameter | Type                              | Description                                                                 |\n| --------- | --------------------------------- | --------------------------------------------------------------------------- |\n| object    | `Function` \\| `Object` \\| `Array` | Function or object to bind itself and all of its methods                    |\n| thisArg   | `Object`                          | The value bound to `this` for each bound function and method when called    |\n| [...args] | `any`                             | Arguments provided to the bound function when the bound function is invoked |\n\n## Example\n\n```js\n// Require bind-deep\nconst bindDeep = require(\"bind-deep\");\n\n\n// Original object and function\n// Could also be an actual object\nconst func = function() {\n    // Use `this`\n};\nfunc.method = function() {\n    // Use `this` again\n};\n\nconst obj = {\n    method() {\n        // Use `this`\n    }\n};\n\n\n// Deeply bound object and function\n// `thisArg` will be what every function and method will see as `this`\nconst boundObj = bindDeep(obj, thisArg);\n// =\u003e {method: [Function: bound]}\n\nconst boundFunc = bindDeep(func, thisArg);\n// =\u003e {[Function: bound] method: [Function: bound]}\n```\n\n### TypeScript\n\nAll types inferred or annotated are preserved from the original functions and objects. The type definitions are incredibly strong deep types as the only negative side-effects are:\n\n- If bound arguments are added, the arguments in call signatures are renamed by their bound position.\n- If more than around 39 bound arguments are added, TypeScript will error `Type instantiation is excessively deep and possibly infinite.`\n    - If you somehow do this, slap on an `as any` or your manually created type\n\nAn in-depth explanation is commented inside of [`index.d.ts`](./index.d.ts) and below with example code.\n\n```ts\n// Import bind-deep\nimport bindDeep from \"bind-deep\";\n\n\ninterface OriginalThis {\n    discriminator: string;\n}\n\n// Original function\nconst myFunction = function (this: OriginalThis, arg1: string, arg2: number) {\n    return this;\n};\nmyFunction.method = function (this: OriginalThis, arg1: string) {\n    return this;\n};\nmyFunction.primitive = \"string\";\n\n// `thisArg` value\nconst newThis = { newThis: \"that's me!\"};\n\n// Deeply bound functions\nconst boundFunction = bindDeep(myFunction, newThis);\nconst boundFunctionWithArgs = bindDeep(myFunction, newThis, \"add arg1 for each function\");\n\n/*\n    Root call signature: `(arg1: string, arg2: number) =\u003e OriginalThis`\n    - `this` argument type omitted from the original call signature as it is now bound\n    - All other argument types and names are preserved\n    - Returns `newThis` as `OriginalThis` due to the return value inferred by TypeScript\n*/\nboundFunction(\"arg1\", 10); // returns `newThis`\n/*\n    Root call signature when passing an argument: `((args_0: number) =\u003e OriginalThis)`\n    - Similar explanation to the root call signature\n    - `arg1` argument type omitted from the original call signature as it is now bound\n    - `arg2` is represented as `args_0` with the number type preserved\n        - This unfortunate renaming only occurs when binding arguments\n*/\nboundFunctionWithArgs(10); // returns `newThis`\n\n/*\n    Method call signature: `(method) method(arg1: string): OriginalThis`\n*/\nboundFunction.method(\"arg1\"); // returns `newThis`\n/*\n    Method call signature when passing an argument: `(method) method(): OriginalThis`\n*/\nboundFunctionWithArgs.method(); // returns `newThis`\n\n/*\n    Primitive property type: `primitive: string`\n*/\nconst myString: string = boundFunction.primitive; // still \"string\", typings preserved\n```\n\n---\n\n## License\n\nCopyright Evelyn Hathaway, [MIT License](/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevelynhathaway%2Fbind-deep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevelynhathaway%2Fbind-deep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevelynhathaway%2Fbind-deep/lists"}