{"id":31559425,"url":"https://github.com/amrsaber/async-short-circuit","last_synced_at":"2025-10-05T01:38:32.504Z","repository":{"id":42910731,"uuid":"250084622","full_name":"AmrSaber/async-short-circuit","owner":"AmrSaber","description":"Boolean short circuit logic for js proimses","archived":false,"fork":false,"pushed_at":"2023-01-07T16:24:05.000Z","size":503,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-02T03:55:12.497Z","etag":null,"topics":["and","async","circuit","javascript","js","logic","or","promise","promises","short"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmrSaber.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-25T20:29:51.000Z","updated_at":"2024-09-20T12:16:26.000Z","dependencies_parsed_at":"2023-02-07T15:30:23.937Z","dependency_job_id":null,"html_url":"https://github.com/AmrSaber/async-short-circuit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/AmrSaber/async-short-circuit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrSaber%2Fasync-short-circuit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrSaber%2Fasync-short-circuit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrSaber%2Fasync-short-circuit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrSaber%2Fasync-short-circuit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmrSaber","download_url":"https://codeload.github.com/AmrSaber/async-short-circuit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrSaber%2Fasync-short-circuit/sbom","scorecard":{"id":12816,"data":{"date":"2025-08-11","repo":{"name":"github.com/AmrSaber/async-short-circuit","commit":"0953cd43fbae72008f17ea5b7d4d8ca170e47069"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/11 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":"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":"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":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/AmrSaber/async-short-circuit/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/AmrSaber/async-short-circuit/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/AmrSaber/async-short-circuit/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/AmrSaber/async-short-circuit/release.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/release.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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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 24 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":"13 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-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-c2qf-rxjj-qqgw","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-14T14:59:24.084Z","repository_id":42910731,"created_at":"2025-08-14T14:59:24.084Z","updated_at":"2025-08-14T14:59:24.084Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278399622,"owners_count":25980329,"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-04T02:00:05.491Z","response_time":63,"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":["and","async","circuit","javascript","js","logic","or","promise","promises","short"],"created_at":"2025-10-05T01:38:23.652Z","updated_at":"2025-10-05T01:38:32.498Z","avatar_url":"https://github.com/AmrSaber.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Async Short Circuit\n\nPerforms logical AND and OR operations with short circuit on promises.\n\nGiven an array of promises, as soon as a promise whose value can cause a short circuit is resolved, it's value is used and returned and the rest of the promises are ignored.\n\n## Install\n`npm i async-short-circuit`\n\n## Usage\n\n```js\nconst { asyncAnd, asyncOr } = require('async-short-circuit');\n\n// or using import\nimport { asyncAnd, asyncOr } from 'async-short-circuit';\n\n// Some code ...\n\n// AND\nasyncAnd(myPromises).then(value =\u003e { /* perform some logic with AND result */ });\n\n// OR\nasyncOr(myPromises).then(value =\u003e { /* perform some logic with OR result */ });\n```\n\n## API\n- `asyncAnd(promises): Promise\u003cany\u003e` - Returned value depends on the resolve value of the given promises\n    - `promises`: an array of `Promise`s.\n- `asyncOr(promises): Promise\u003cany\u003e` - Returned value depends on the resolve value of the given promises\n    - `promises`: an array of `Promise`s.\n\n## Important Notes\n\n### Short Circuit Logic\nThe given promises are awaited upon, and as soon as one of them resolves, it's value is checked, if its value can cause a short circuit, the returned promise -from short-circuit functions- resolves immediately with that value without waiting for the results of the remaining promises. If the value of the resolved promise does not cause a short circuit, it's ignored and the same logic is applies to other promises.\n\nIf all none of the encountered value would cause short circuit, then the result of ANDing or ORing all the values is returned, which is the last value (the resolved value of the last promise in the given array) according to JS implementation.\n\nAlso note that any short-circuiting does not affect the running of the given promises, all the promises will always run no matter the result, it's just we don't wait for the resolving of the remaining promises if a value is received that causes a short-circuit.\n\n## Features Suggestions and Bug Reports\nFor feature suggestions and/or bug reports, please [open an issue](https://github.com/AmrSaber/async-short-circuit/issues).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrsaber%2Fasync-short-circuit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famrsaber%2Fasync-short-circuit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrsaber%2Fasync-short-circuit/lists"}