{"id":17933966,"url":"https://github.com/papooch/decorate-all","last_synced_at":"2025-10-05T11:20:38.106Z","repository":{"id":42654204,"uuid":"379828037","full_name":"Papooch/decorate-all","owner":"Papooch","description":"Decorate all methods of a class using a single class decorator","archived":false,"fork":false,"pushed_at":"2022-11-09T15:41:41.000Z","size":344,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-07T13:53:44.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/decorate-all","language":"TypeScript","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/Papooch.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":"2021-06-24T06:37:19.000Z","updated_at":"2025-04-05T17:14:12.000Z","dependencies_parsed_at":"2023-01-22T15:15:07.058Z","dependency_job_id":null,"html_url":"https://github.com/Papooch/decorate-all","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Papooch/decorate-all","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fdecorate-all","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fdecorate-all/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fdecorate-all/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fdecorate-all/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Papooch","download_url":"https://codeload.github.com/Papooch/decorate-all/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papooch%2Fdecorate-all/sbom","scorecard":{"id":107734,"data":{"date":"2025-08-11","repo":{"name":"github.com/Papooch/decorate-all","commit":"a2b4fdd4889672f82f1ec13aef9c23cbdd9661c4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/23 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/run-tests.workflow.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/run-tests.workflow.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/Papooch/decorate-all/run-tests.workflow.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tests.workflow.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/Papooch/decorate-all/run-tests.workflow.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 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":"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":"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":"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 'main'"],"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 7 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":"16 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-93q8-gq69-wqmw","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-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-15T11:25:03.523Z","repository_id":42654204,"created_at":"2025-08-15T11:25:03.523Z","updated_at":"2025-08-15T11:25:03.523Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278444553,"owners_count":25987790,"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-05T02:00:06.059Z","response_time":54,"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":[],"created_at":"2024-10-28T21:42:34.815Z","updated_at":"2025-10-05T11:20:38.066Z","avatar_url":"https://github.com/Papooch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# decorate-all\n\nA `typescript` decorator that allows you to apply another decorator to _all_ methods of a class.\n\n```\nnpm i decorate-all\n```\n\n\u003e **Note:** since version `1.1.0`, this package uses the [`reflect-metadata`](https://www.npmjs.com/package/reflect-metadata) package as a _peer dependency_, so you need to have it installed.\n\n## Why\n\nA need for this decorator arose from having to decorate all methods (route handlers) of a controller class with the same parameter decorator to apply the framework-specific metadata. In the project, which is a multi-tenant application, most routes contain the same `tenantId` path parameter and repeating it over each method turned out to be tedious and error prone.\n\nThis decorator is, however, not limited to adding simple metadata decorators. Another use case can be applying a logging decorator (that actually alters the method's implementation) on all methods of a class for debugging or for tracing purposes.\n\n## Usage\n\n```ts\nimport { DecorateAll } from 'decorate-all';\n\nconst Uppercase = (\n    target: any,\n    propertyKey: string,\n    descriptor: PropertyDescriptor,\n) =\u003e {\n    const original = descriptor.value;\n    descriptor.value = function () {\n        return original.call(this).toUpperCase();\n    };\n};\n\n// instead of decorating each method on its own...\nclass Hello1 {\n    @Uppercase\n    world() {\n        return 'world';\n    }\n\n    @Uppercase\n    galaxy() {\n        return 'galaxy';\n    }\n}\n\n// ...use the DecorateAll decorator\n@DecorateAll(Uppercase)\nclass Hello2 {\n    world() {\n        return 'world';\n    }\n    galaxy() {\n        return 'galaxy';\n    }\n}\n\nconst hello1 = new Hello1();\nconsole.log(hello1.world()); // logs \"WORLD\"\nconsole.log(hello1.galaxy()); // logs \"GALAXY\"\n\nconst hello2 = new Hello2();\nconsole.log(hello2.world()); // logs \"WORLD\"\nconsole.log(hello2.galaxy()); // logs \"GALAXY\"\n```\n\n## Options\n\nThe second parameter of the `DecorateAll` decorator takes an options object with the following options:\n\n-   `exclude: string[]`  \n    array of method names that won't be decorated\n\n```ts\n// apply the Uppercase decorator to all methods, except 'galaxy'\n@DecorateAll(Uppercase, { exclude: ['galaxy'] })\nclass Hello {\n    world() {\n        return 'world';\n    }\n    galaxy() {\n        return 'galaxy';\n    }\n    universe() {\n        return 'universe';\n    }\n}\n\nconst hello = new Hello();\nconsole.log(hello.world()); // logs \"WORLD\"\nconsole.log(hello.galaxy()); // logs \"galaxy\"\nconsole.log(hello.universe()); // logs \"UNIVERSE\"\n```\n\n-   `excludePrefix: string`  \n    methods with the given prefix won't be decorated\n\n```ts\n// apply the Uppercase decorator to all methods, except 'galaxy'\n@DecorateAll(Uppercase, { excludePrefix: '_' })\nclass Hello {\n    world() {\n        return 'world';\n    }\n    _galaxy() {\n        return 'galaxy';\n    }\n    universe() {\n        return 'universe';\n    }\n}\n\nconst hello = new Hello();\nconsole.log(hello.world()); // logs \"WORLD\"\nconsole.log(hello._galaxy()); // logs \"galaxy\"\nconsole.log(hello.universe()); // logs \"UNIVERSE\"\n```\n\n-   `deep: boolean`  \n    By default, only the class' own methods are decorated. If you pass `deep: true`, the decorator will be also applied to inherited methods of any extended class. (It can also be combined with the exclude options).\n\n```ts\nclass Plain {\n    hi() {\n        return 'hi';\n    }\n    hello() {\n        return 'hello';\n    }\n}\n\n@DecorateAll(Uppercase, { deep: true })\nclass Decorated extends Plain {}\n\nconst plain = new Plain();\nconsole.log(plain.hi()); // logs \"hi\"\nconsole.log(plain.hello()); // logs \"hello\"\n\nconst decorated = new Decorated();\nconsole.log(decorated.hi()); // logs \"HI\"\nconsole.log(decorated.hello()); // logs \"HELLO\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapooch%2Fdecorate-all","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpapooch%2Fdecorate-all","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapooch%2Fdecorate-all/lists"}