{"id":22214230,"url":"https://github.com/lordazzi/taipescripeto-enum-type-guard","last_synced_at":"2026-05-18T14:06:51.706Z","repository":{"id":37882783,"uuid":"258296140","full_name":"lordazzi/taipescripeto-enum-type-guard","owner":"lordazzi","description":"Check if an string or number is compatible to an TypeScript enum structure","archived":false,"fork":false,"pushed_at":"2023-01-06T04:18:07.000Z","size":485,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T14:19:09.974Z","etag":null,"topics":["angular","enum","guard","ng","ts","type","type-guard","typescript"],"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/lordazzi.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":"2020-04-23T18:30:28.000Z","updated_at":"2022-06-02T08:21:45.000Z","dependencies_parsed_at":"2023-02-05T07:02:12.508Z","dependency_job_id":null,"html_url":"https://github.com/lordazzi/taipescripeto-enum-type-guard","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lordazzi/taipescripeto-enum-type-guard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Ftaipescripeto-enum-type-guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Ftaipescripeto-enum-type-guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Ftaipescripeto-enum-type-guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Ftaipescripeto-enum-type-guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lordazzi","download_url":"https://codeload.github.com/lordazzi/taipescripeto-enum-type-guard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lordazzi%2Ftaipescripeto-enum-type-guard/sbom","scorecard":{"id":599016,"data":{"date":"2025-08-11","repo":{"name":"github.com/lordazzi/taipescripeto-enum-type-guard","commit":"aa625a3cc9702aba3bdf97ed6cad0c087f5e5708"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 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":"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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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 '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":"Vulnerabilities","score":0,"reason":"51 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-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c","Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-mgfv-m47x-4wqp","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg"],"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-20T23:53:41.332Z","repository_id":37882783,"created_at":"2025-08-20T23:53:41.332Z","updated_at":"2025-08-20T23:53:41.332Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33180337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"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":["angular","enum","guard","ng","ts","type","type-guard","typescript"],"created_at":"2024-12-02T21:14:37.595Z","updated_at":"2026-05-18T14:06:51.689Z","avatar_url":"https://github.com/lordazzi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript Enum Type Guard\nSome simple tools for TypeScript, it will help your daily development\n\n\u003e taipescripeto custos autem enumeratio\n\n[![npm version](https://badge.fury.io/js/%40taipescripeto%2Fenum-type-guard.svg)](https://badge.fury.io/js/%40taipescripeto%2Fenum-type-guard)\n[![Build Status](https://travis-ci.org/lordazzi/taipescripeto-enum-type-guard.svg?branch=master)](https://travis-ci.org/lordazzi/taipescripeto-enum-type-guard)\n[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/lordazzi/taipescripeto-enum-type-guard/blob/master/LICENSE)\n\n## Installation\n\n```bash\nnpm install @taipescripeto/enum-type-guard --save\n```\n\n# Usage\nA type guard is a method or keyword with power of something like cast in TypeScript.\nWhen a type guard is used to check the type of an information in a conditional structure, the following code assume the validated type as the information type.\n\n![Type Guard example](imgs/type-guard-example.png)\n\nThis feature is basically the Type Guard to identify enum data.\n\n```typescript\nimport { enumTypeGuard } from '@taipescripeto/enum-type-guard';\n\n/**\n * The application domain\n */\nenum PokemonType {\n  FIRE = 'FIRE',\n  GRASS = 'GRASS',\n  WATER = 'WATER'\n}\n\ninterface Pokemon {\n  name: string;\n  type: PokemonType;\n}\n\n/**\n * External data collect (an api for example)\n */\nconst externalDataAboutPokemon = JSON.parse('{\"name\":\"Charmander\",\"type\":\"FIRE\"}');\n\n/**\n * Type Guard function\n */\nfunction isPokemon(pokemonIGuess: unknown): pokemonIGuess is Pokemon {\n  //  If it is null or isn't an object, isn't a Pokémon model\n  if (!pokemonIGuess || !(pokemonIGuess instanceof Object)) {\n    return false;\n  }\n\n  //  ignore that\n  const someObject = pokemonIGuess as { [prop: string]: unknown };\n\n  //  the type check\n  if (\n    !(typeof someObject.name === 'string' \u0026\u0026\n      enumTypeGuard(someObject.type, PokemonType))\n  ) {\n    return false;\n  }\n\n  return true;\n}\n\nif (isPokemon(externalDataAboutPokemon)) {\n  externalDataAboutPokemon\n}\n```\n\nYou can see in this print the TypeScript recognizing the external data as an enum:\n![Type Guard example](./imgs/enum-type-guard-working.png)\n\n## Contributing\n\n### 1. Create an issue\nNo one feature will be implemented without it having an open issue and without which the proposed has been accepted by the team responsible for the project. After the issue is approved, the applicant, a team member or anyone else can open a pull request associated with that issue (just paste the issue link in the pull request).\n\n### 2. Did you find a bug?\nWhen logging a bug, please be sure to include the following:\n * The library version;\n * If at all possible, an *isolated* way to reproduce the behavior;\n * The behavior you expect to see, and the actual behavior.\n\nYou can try to update the library to the last version to see if the bug has already been fixed.\n\n### 3. Do not create a duplicate issue\n[Search the existing issues](https://github.com/lordazzi/taipescripeto-enum-type-guard/search?type=Issues) before logging a new one.\n\nSome search tips:\n * *Don't* restrict your search to only open issues. An issue with a title similar to yours may have been closed as a duplicate of one with a less-findable title.\n * Check for synonyms. For example, if your bug involves an interface, it likely also occurs with type aliases or classes.\n\n### 4. Create a Pull Request\nFollow the steps:\n\n * Create a [fork](https://guides.github.com/activities/forking/) from our repository, install [node](https://nodejs.org/), and run `npm install` in the application folder;\n * Create a branch in your forked repository, then code the feature or fix the bug;\n * Run `npm run lint`, `npm run test` and `npm run build` in the repository;\n * Create a Pull Request from your repository to this one, with the issue in the body and some information you think could be usefull to the reviewer (print or a [gif of it working](https://www.screentogif.com/) will be appreciated);\n * The reviewer can ask some changes, don't be mad, this is the GIT Flow process;\n * You get approved and your branch with the feature / fix ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordazzi%2Ftaipescripeto-enum-type-guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flordazzi%2Ftaipescripeto-enum-type-guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordazzi%2Ftaipescripeto-enum-type-guard/lists"}