{"id":15819469,"url":"https://github.com/xunnamius/toss-expression","last_synced_at":"2026-03-06T06:32:07.313Z","repository":{"id":57378237,"uuid":"360518133","full_name":"Xunnamius/toss-expression","owner":"Xunnamius","description":"⚡ A tiny ponyfill for @babel/plugin-proposal-throw-expressions, the syntax from which TypeScript and VS Code do not (yet) support","archived":false,"fork":false,"pushed_at":"2024-05-31T09:38:25.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T04:58:24.558Z","etag":null,"topics":["babel","code","expression","expressions","invalid","proposal","statement","support","throw","toss","typescript","vs"],"latest_commit_sha":null,"homepage":"https://npm.im/toss-expression","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/Xunnamius.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}},"created_at":"2021-04-22T12:52:42.000Z","updated_at":"2024-08-22T14:01:28.000Z","dependencies_parsed_at":"2024-06-21T14:22:48.950Z","dependency_job_id":null,"html_url":"https://github.com/Xunnamius/toss-expression","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"650146d5626fb8d28256ea21e52d0d526991ad07"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Xunnamius/toss-expression","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xunnamius%2Ftoss-expression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xunnamius%2Ftoss-expression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xunnamius%2Ftoss-expression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xunnamius%2Ftoss-expression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xunnamius","download_url":"https://codeload.github.com/Xunnamius/toss-expression/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xunnamius%2Ftoss-expression/sbom","scorecard":{"id":153809,"data":{"date":"2025-08-11","repo":{"name":"github.com/Xunnamius/toss-expression","commit":"9385bb237dae5b161c7ca302b5ff6ac33fc1d67a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/10 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":"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":-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":"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":"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":"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"}},{"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"}}]},"last_synced_at":"2025-08-16T11:16:27.440Z","repository_id":57378237,"created_at":"2025-08-16T11:16:27.440Z","updated_at":"2025-08-16T11:16:27.440Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278911624,"owners_count":26067294,"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-08T02:00:06.501Z","response_time":56,"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":["babel","code","expression","expressions","invalid","proposal","statement","support","throw","toss","typescript","vs"],"created_at":"2024-10-05T06:41:15.285Z","updated_at":"2025-10-08T08:25:22.509Z","avatar_url":"https://github.com/Xunnamius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- prettier-ignore-start --\u003e\n\n\u003c!-- badges-start --\u003e\n\n[![Black Lives Matter!][badge-blm]][link-blm]\n[![Maintenance status][badge-maintenance]][link-repo]\n[![Last commit timestamp][badge-last-commit]][link-repo]\n[![Open issues][badge-issues]][link-issues]\n[![Pull requests][badge-pulls]][link-pulls]\n[![codecov][badge-codecov]][link-codecov]\n[![Source license][badge-license]][link-license]\n[![NPM version][badge-npm]][link-npm]\n[![semantic-release][badge-semantic-release]][link-semantic-release]\n\n\u003c!-- badges-end --\u003e\n\n\u003c!-- prettier-ignore-end --\u003e\n\n# toss-expression\n\nWhile\n[Babel supports throw expressions via plugins](https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions),\n[TypeScript and VS Code do not (yet)](https://github.com/microsoft/TypeScript/issues/18535).\nHence this five line ponyfill takes the place of the currently-unavailable\n[`@babel/plugin-proposal-throw-expressions`](https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions)\nsyntax.\n\n```typescript\n// Though the following is supported by Babel, VS Code/TypeScript will complain\nconst userToken = secureRequest() || throw new SecureAccessError('badness occurred');\n\n// No errors\nconst userToken = secureRequest() || toss(new SecureAccessError('badness occurred'));\n```\n\n## Installation and Usage\n\n```bash\nnpm install toss-expression\n```\n\n```typescript\n// ESM\nimport { toss } from 'toss-expression';\nconsole.log(successMessage() || toss('log operation failed'));\n```\n\n```javascript\n// CJS\nconst { toss } = require('toss-expression');\nconsole.log(successMessage() || toss('log operation failed'));\n```\n\n## Documentation\n\nFurther documentation can be found under [`docs/`][docs].\n\n## Contributing and Support\n\n**[New issues][choose-new-issue] and [pull requests][pr-compare] are always\nwelcome and greatly appreciated! 🤩** Just as well, you can [star 🌟 this\nproject][link-repo] to let me know you found it useful! ✊🏿 Thank you!\n\nSee [CONTRIBUTING.md][contributing] and [SUPPORT.md][support] for more\ninformation.\n\n[badge-blm]: https://xunn.at/badge-blm 'Join the movement!'\n[link-blm]: https://xunn.at/donate-blm\n[badge-maintenance]:\n  https://img.shields.io/maintenance/active/2024\n  'Is this package maintained?'\n[link-repo]: https://github.com/xunnamius/toss-expression\n[badge-last-commit]:\n  https://img.shields.io/github/last-commit/xunnamius/toss-expression\n  'When was the last commit to the official repo?'\n[badge-issues]:\n  https://isitmaintained.com/badge/open/Xunnamius/toss-expression.svg\n  'Number of known issues with this package'\n[link-issues]: https://github.com/Xunnamius/toss-expression/issues?q=\n[badge-pulls]:\n  https://img.shields.io/github/issues-pr/xunnamius/toss-expression\n  'Number of open pull requests'\n[link-pulls]: https://github.com/xunnamius/toss-expression/pulls\n[badge-codecov]:\n  https://codecov.io/gh/Xunnamius/toss-expression/branch/main/graph/badge.svg?token=HWRIOBAAPW\n  'Is this package well-tested?'\n[link-codecov]: https://codecov.io/gh/Xunnamius/toss-expression\n[package-json]: package.json\n[badge-license]:\n  https://img.shields.io/npm/l/toss-expression\n  \"This package's source license\"\n[link-license]: https://github.com/Xunnamius/toss-expression/blob/main/LICENSE\n[badge-npm]:\n  https://api.ergodark.com/badges/npm-pkg-version/toss-expression\n  'Install this package using npm or yarn!'\n[link-npm]: https://www.npmjs.com/package/toss-expression\n[badge-semantic-release]:\n  https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n  'This repo practices continuous integration and deployment!'\n[link-semantic-release]: https://github.com/semantic-release/semantic-release\n[docs]: docs\n[choose-new-issue]:\n  https://github.com/Xunnamius/toss-expression/issues/new/choose\n[pr-compare]: https://github.com/Xunnamius/toss-expression/compare\n[contributing]: CONTRIBUTING.md\n[support]: .github/SUPPORT.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxunnamius%2Ftoss-expression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxunnamius%2Ftoss-expression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxunnamius%2Ftoss-expression/lists"}