{"id":44931461,"url":"https://github.com/tsdotnet/reflection","last_synced_at":"2026-02-18T06:02:42.770Z","repository":{"id":57168023,"uuid":"260512532","full_name":"tsdotnet/reflection","owner":"tsdotnet","description":"A set of classes and utilities for JavaScript type inspection and validation.","archived":false,"fork":false,"pushed_at":"2026-02-04T06:57:30.000Z","size":973,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-04T18:07:25.692Z","etag":null,"topics":["reflection","runtime-type","runtime-typechecking","type-assertion","type-inspection"],"latest_commit_sha":null,"homepage":null,"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/tsdotnet.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-01T17:00:07.000Z","updated_at":"2026-02-04T06:57:35.000Z","dependencies_parsed_at":"2023-01-29T19:45:46.819Z","dependency_job_id":"ec91bb4d-70e6-4c1d-bbc0-04269c3306c0","html_url":"https://github.com/tsdotnet/reflection","commit_stats":{"total_commits":116,"total_committers":3,"mean_commits":"38.666666666666664","dds":"0.15517241379310343","last_synced_commit":"043738f9efeb5a812580e64274c98708b0f96a89"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/tsdotnet/reflection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsdotnet%2Freflection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsdotnet%2Freflection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsdotnet%2Freflection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsdotnet%2Freflection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsdotnet","download_url":"https://codeload.github.com/tsdotnet/reflection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsdotnet%2Freflection/sbom","scorecard":{"id":900624,"data":{"date":"2025-08-11","repo":{"name":"github.com/tsdotnet/reflection","commit":"8e18992283a3499d6c1b1bbb8f2fe8520a63734f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/26 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/publish.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":"Maintained","score":9,"reason":"11 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 9","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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/tsdotnet/reflection/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/tsdotnet/reflection/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/tsdotnet/reflection/publish.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish.yml:34","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 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":"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":"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:10"],"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":"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 4 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":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"}}]},"last_synced_at":"2025-08-24T15:26:18.532Z","repository_id":57168023,"created_at":"2025-08-24T15:26:18.532Z","updated_at":"2025-08-24T15:26:18.532Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29569995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T04:18:28.490Z","status":"ssl_error","status_checked_at":"2026-02-18T04:13:49.018Z","response_time":162,"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":["reflection","runtime-type","runtime-typechecking","type-assertion","type-inspection"],"created_at":"2026-02-18T06:02:40.737Z","updated_at":"2026-02-18T06:02:42.714Z","avatar_url":"https://github.com/tsdotnet.png","language":"TypeScript","readme":"# ![alt text](https://avatars1.githubusercontent.com/u/64487547?s=30 \"tsdotnet\") tsdotnet / reflection\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/tsdotnet/reflection/blob/master/LICENSE)\n![npm-publish](https://github.com/tsdotnet/reflection/workflows/npm-publish/badge.svg)\n[![npm version](https://img.shields.io/npm/v/@tsdotnet/reflection.svg?style=flat-square)](https://www.npmjs.com/package/@tsdotnet/reflection)\n\nA set of classes and utilities for JavaScript type inspection and validation.\n\n## Docs\n\n[tsdotnet.github.io/reflection](https://tsdotnet.github.io/reflection/)\n\n## `TypeValidator\u003cT\u003e`\n\n### Benefits\n\n- Allows for run-time validation and checking of dynamic types as well as integrated **type-guarding**.\n- Super easy to use, basically only requires a copy paste.\n- Works with literals!\n\n### Usage\n\n#### Step 1: Declare the expected type/interface.\n\n```typescript\ninterface MyType\n{\n    a: object;\n    b: string;\n    c: number;\n    d: boolean;\n    e: {\n        f: string;\n        g: boolean;\n        h: [\n            number,\n            boolean,\n            string\n        ];\n    };\n}\n```\n\n#### Step 2: Copy the interface as an actual object and `\u003ctype\u003e` the validator\n\nThe following can be done with pure JavaScript and still work.\n\n```typescript\nconst myTypeValidator = new TypeValidator\u003cMyType\u003e(\n{\n    a: Object,\n    b: String,\n    c: Number,\n    d: Boolean,\n    e: {\n        f: String,\n        g: Boolean,\n        h: [\n            Number,\n            Boolean,\n            String\n        ]\n    }\n});\n```\n\n#### Step 3: validate as many times as you want:\n\n```typescript\nconst myItem = {\n    a: {},\n    b: 'hello',\n    c: 1,\n    d: true,\n    e: {\n        f: 'whatever',\n        g: false,\n        h: [\n            0,\n            true,\n            '2'\n        ]\n    },\n    i: 'noise'\n};\n\n// no compile-time type errors!\nif (MyTypeValidator.isSubsetOf(myItem)) {\n    console.log(myItem.e.h.length); // 3\n    console.log(myItem.b); // \"hello\"\n} else {\n    throw new TypeError('Invalid type!');\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsdotnet%2Freflection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsdotnet%2Freflection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsdotnet%2Freflection/lists"}