{"id":17757845,"url":"https://github.com/lopatnov/join","last_synced_at":"2026-01-20T21:33:34.861Z","repository":{"id":42722000,"uuid":"286134222","full_name":"lopatnov/join","owner":"lopatnov","description":"Object join technics.","archived":false,"fork":false,"pushed_at":"2023-03-05T10:07:56.000Z","size":610,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-21T05:39:12.314Z","etag":null,"topics":["join","object","typescript-library"],"latest_commit_sha":null,"homepage":"https://lopatnov.github.io/join/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lopatnov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"lopatnov"}},"created_at":"2020-08-08T23:23:32.000Z","updated_at":"2025-02-22T06:03:12.000Z","dependencies_parsed_at":"2024-10-26T17:52:12.120Z","dependency_job_id":"268a38ee-2b78-4f72-8923-940cd25240c3","html_url":"https://github.com/lopatnov/join","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"28cfc3f3ca8722dc77775e61f1d577af01f459fb"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":"My-Templates/TypeScript-Library","purl":"pkg:github/lopatnov/join","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopatnov%2Fjoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopatnov%2Fjoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopatnov%2Fjoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopatnov%2Fjoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lopatnov","download_url":"https://codeload.github.com/lopatnov/join/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopatnov%2Fjoin/sbom","scorecard":{"id":598897,"data":{"date":"2025-08-11","repo":{"name":"github.com/lopatnov/join","commit":"28cfc3f3ca8722dc77775e61f1d577af01f459fb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/25 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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build-and-test-package.yml:1","Warn: no topLevel permission defined: .github/workflows/publish-npm-package.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":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":"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":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-and-test-package.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/build-and-test-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-and-test-package.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/build-and-test-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm-package.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/publish-npm-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm-package.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/publish-npm-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm-package.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/publish-npm-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm-package.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/publish-npm-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm-package.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/publish-npm-package.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm-package.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/lopatnov/join/publish-npm-package.yml/master?enable=pin","Info:   0 out of   8 GitHub-owned 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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":"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":"20 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-w573-4hg7-7wgq","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-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","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-20T23:51:29.826Z","repository_id":42722000,"created_at":"2025-08-20T23:51:29.826Z","updated_at":"2025-08-20T23:51:29.826Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28614612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"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":["join","object","typescript-library"],"created_at":"2024-10-26T17:09:13.673Z","updated_at":"2026-01-20T21:33:34.842Z","avatar_url":"https://github.com/lopatnov.png","language":"TypeScript","readme":"# @lopatnov/join [![Twitter](https://img.shields.io/twitter/url?url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40lopatnov%2Fjoin)](https://twitter.com/intent/tweet?text=I%20want%20to%20share%20TypeScript%20library:\u0026url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40lopatnov%2Fjoin)\n\n[![npm](https://img.shields.io/npm/dt/@lopatnov/join)](https://www.npmjs.com/package/@lopatnov/join)\n[![NPM version](https://badge.fury.io/js/%40lopatnov%2Fjoin.svg)](https://www.npmjs.com/package/@lopatnov/join)\n[![GitHub issues](https://img.shields.io/github/issues/lopatnov/join)](https://github.com/lopatnov/join/issues)\n[![GitHub forks](https://img.shields.io/github/forks/lopatnov/join)](https://github.com/lopatnov/join/network)\n[![GitHub stars](https://img.shields.io/github/stars/lopatnov/join)](https://github.com/lopatnov/join/stargazers)\n[![License](https://img.shields.io/github/license/lopatnov/join)](https://github.com/lopatnov/join/blob/master/LICENSE)\n\n[![build-and-test-package](https://github.com/lopatnov/join/workflows/build-and-test-package/badge.svg)](https://github.com/lopatnov/join/tree/master/tests)\n[![publish-npm-package](https://github.com/lopatnov/join/workflows/publish-npm-package/badge.svg)](https://github.com/lopatnov/join/releases)\n[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/@lopatnov/join)](https://www.npmjs.com/package/@lopatnov/join?activeTab=dependencies)\n\n[![Patreon](https://img.shields.io/badge/Donate-Patreon-informational)](https://www.patreon.com/lopatnov)\n[![sobe.ru](https://img.shields.io/static/v1?label=sobe.ru\u0026message=%D0%91%D0%BB%D0%B0%D0%B3%D0%BE%D0%B4%D0%B0%D1%80%D0%BD%D0%BE%D1%81%D1%82%D1%8C\u0026color=yellow\u0026logo=data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAArlBMVEUAAAD//////////////////////////////////////////////////////////////////PP/3l7/9c//0yb/zAD/6ZP/zQf/++7/3FD/88X/0h7//v7/5oX/zATUqQDktgD/5HjQpgAFBACQcwD/zw/fsgCOcQD6yADZrQD2xAD8yQDnuADxwADcsADbrwDpugD3xQD5xwDjtQDywQD+ywD9ygDvvwD7yAD/1jRaObVGAAAAEHRSTlMAA3zg707pEJP8MMUBYN5fiwXJMQAAAAFiS0dEAf8CLd4AAAAHdElNRQflBgMAAxO4O2jCAAAAuElEQVQoz42S1w7CMAxFS8ueYZgNLZuyRynw/z9GdtxIkbgPceQT6Tq2vZwfEKx8wRPyiaViSYDABqQsAMq0OzxUqhbo9kBcavUM6A9AAtJAYDgC0ID7i+t4AghwfxanszlAGBnA/Flc0MfL1doA5s/ChoLtbg8QI392gpIBzf/AwYAWAsdTrIE05/nz5Xq7S6DKpenHM0pe+o/qg5Am74/0ybTkm+q6wG4iltV2LTko52idy+Banx9RYiS6Vrsc3AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wNi0wM1QwMDowMzoxOCswMDowMLvSSCkAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDYtMDNUMDA6MDM6MTgrMDA6MDDKj/CVAAAAAElFTkSuQmCC)](https://sobe.ru/na/tech_knigi)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-lopatnov-informational?style=social\u0026logo=linkedin)](https://www.linkedin.com/in/lopatnov/)\n\nObject join technics.\n\n## Install\n\n[![https://nodei.co/npm/@lopatnov/join.png?downloads=true\u0026downloadRank=true\u0026stars=true](https://nodei.co/npm/@lopatnov/join.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/@lopatnov/join)\n\n```shell\nnpm install @lopatnov/join\n```\n\n[Browser](https://lopatnov.github.io/join/dist/join.js)\n\n```html\n\u003cscript src=\"https://lopatnov.github.io/join/dist/join.min.js\"\u003e\u003c/script\u003e\n```\n\n## Import package to the project\n\n### TypeScript\n\n```typescript\nimport { join, JoinTypes } from \"@lopatnov/join\";\n```\n\n### JavaScript\n\n```javascript\nvar library = require(\"@lopatnov/join\");\nvar join = library.join;\nvar JoinTypes = library.JoinTypes;\n```\n\n## Join Types\n\n![Join Types](./img/join-types.png)\n\n```typescript\nenum JoinTypes {\n  none       = 0b0000,\n  left       = 0b1000, // take unique left object properties\n  right      = 0b0001, // take unique right object properties\n  innerLeft  = 0b0100, // take non-unique (inner) properties from left object\n  innerRight = 0b0010, // take non-unique (inner) properties from right object\n  innerJoin  = none | innerLeft | innerRight | none, // innerLeft + innerRight = deep merge inner join of two objects\n  leftJoin   = left | innerLeft | innerRight | none,\n  rightJoin  = none | innerLeft | innerRight | right,\n  fullJoin   = left | innerLeft | innerRight | right,\n  expand     = left | none      | innerRight | right\n}\n```\n\n`JoinTypes.expand` is default join type\n\n## How to use\n\n```ts\n// 1. Set join Type\nfunction join(joinType?: JoinTypes) =\u003e (local function)\u003cTContext\u003e(context: TContext)\n```\n\n```ts\n// 2. Set context (left object)\n(local function)\u003cTContext\u003e(context: TContext) =\u003e (local function)\u003cTJoinObject\u003e(joinObject: TJoinObject)\n```\n\n```ts\n// 3. Set join object (right object) and gets result\n(local function)\u003cTJoinObject\u003e(joinObject: TJoinObject): TContext \u0026 TJoinObject\n```\n\n### As three separate operations\n\n#### Right join sample\n\n```typescript\nconst rightJoin = join(JoinTypes.right);\n\nconst contextJoinBy = rightJoin({\n  sample1: \"One\",\n  sample2: \"Two\",\n  sample3: \"Three\",\n});\n\nconst result = contextJoinBy({\n  sample2: \"Dos\",\n  sample3: \"Tres\",\n  sample4: \"Quatro\",\n});\n\nconsole.log(result); // { sample4: \"Quatro\" }\n```\n\n#### Left join sample\n\n```typescript\nconst leftJoin = join(JoinTypes.left);\n\nconst contextJoinBy = leftJoin({\n  sample1: \"One\",\n  sample2: \"Two\",\n  sample3: \"Three\",\n});\n\nconst result = contextJoinBy({\n  sample2: \"Dos\",\n  sample3: \"Tres\",\n  sample4: \"Quatro\",\n});\n\nconsole.log(result); // { sample1: \"One\" }\n```\n\n#### Complex join sample\n\n```typescript\nconst complexJoin = join(JoinTypes.left | JoinTypes.innerLeft | JoinTypes.right);\n\nconst contextJoinBy = complexJoin({\n  sample1: \"One\",\n  sample2: \"Two\",\n  sample3: \"Three\",\n});\n\nconst result = contextJoinBy({\n  sample2: \"Dos\",\n  sample3: \"Tres\",\n  sample4: \"Quatro\",\n});\n\nconsole.log(result); // {sample1: \"One\", sample2: \"Two\", sample3: \"Three\", sample4: \"Quatro\"}\n```\n\n#### Inner join sample\n\n```typescript\nconst result = join(JoinTypes.innerJoin)({\n  sample1: \"One\",\n  sample2: \"Two\",\n  sample3: {\n    smile: \"cheese\",\n  },\n})({\n  sample2: \"Dos\",\n  sample3: {\n    sorrir: \"queijo\",\n  },\n  sample4: \"Quatro\",\n});\n\nconsole.log(result); // {sample2: \"Dos\", sample3: {smile: \"cheese\", sorrir: \"queijo\"}}\n```\n\n## Demo\n\nSee, how it's working: [https://runkit.com/lopatnov/join](https://runkit.com/lopatnov/join)\n\nTest it with a runkit: [https://npm.runkit.com/@lopatnov/join](https://npm.runkit.com/%40lopatnov%2Fjoin)\n\n## Rights and Agreements\n\nLicense [Apache-2.0](https://github.com/lopatnov/join/blob/master/LICENSE)\n\nCopyright 2020–2021 Oleksandr Lopatnov\n","funding_links":["https://patreon.com/lopatnov","https://www.patreon.com/lopatnov"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopatnov%2Fjoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flopatnov%2Fjoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopatnov%2Fjoin/lists"}