{"id":21407479,"url":"https://github.com/palashmon/unique-objects","last_synced_at":"2025-09-10T05:34:17.600Z","repository":{"id":57386314,"uuid":"140866656","full_name":"palashmon/unique-objects","owner":"palashmon","description":"Get unique objects from an array of objects based on single/multiple keys.","archived":false,"fork":false,"pushed_at":"2025-09-01T03:40:40.000Z","size":114,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-01T04:11:28.471Z","etag":null,"topics":["array","array-item","array-of-objects","javascript-array","json","objects","tiny-library","unique"],"latest_commit_sha":null,"homepage":"","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/palashmon.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}},"created_at":"2018-07-13T15:55:45.000Z","updated_at":"2025-09-01T03:40:43.000Z","dependencies_parsed_at":"2024-02-22T08:27:57.112Z","dependency_job_id":"33211f3d-f31e-40fc-9384-92f9bcdd08ab","html_url":"https://github.com/palashmon/unique-objects","commit_stats":{"total_commits":38,"total_committers":5,"mean_commits":7.6,"dds":0.5263157894736843,"last_synced_commit":"ff070baf8774dc799772f91aab49d977656998a8"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/palashmon/unique-objects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Funique-objects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Funique-objects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Funique-objects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Funique-objects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palashmon","download_url":"https://codeload.github.com/palashmon/unique-objects/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Funique-objects/sbom","scorecard":{"id":718243,"data":{"date":"2025-08-11","repo":{"name":"github.com/palashmon/unique-objects","commit":"5f68e78a4affea0c76854f3228726ab951cd650e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"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":"Code-Review","score":0,"reason":"Found 0/29 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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/gh-release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/palashmon/unique-objects/gh-release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/palashmon/unique-objects/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/palashmon/unique-objects/npm-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-labeler.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/palashmon/unique-objects/pr-labeler.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/stale.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/palashmon/unique-objects/stale.yml/master?enable=pin","Info:   0 out of   5 third-party GitHubAction 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":"Maintained","score":3,"reason":"3 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 3","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'contents' permission set to 'write': .github/workflows/gh-release.yml:13","Warn: topLevel 'packages' permission set to 'write': .github/workflows/gh-release.yml:14","Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/pr-labeler.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":"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":"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":"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":"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":"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":-1,"reason":"internal error: internal error: Client.Checks.ListCheckRunsForRef: error during graphqlHandler.setupCheckRuns: Something went wrong while executing your query on 2025-08-12T16:00:50Z. Please include `A370:8B403:83621F:1A04E2D:689B6531` when reporting this issue.","details":null,"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T10:24:26.838Z","repository_id":57386314,"created_at":"2025-08-22T10:24:26.838Z","updated_at":"2025-08-22T10:24:26.838Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274417306,"owners_count":25281108,"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-09-10T02:00:12.551Z","response_time":83,"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":["array","array-item","array-of-objects","javascript-array","json","objects","tiny-library","unique"],"created_at":"2024-11-22T16:52:50.771Z","updated_at":"2025-09-10T05:34:17.568Z","avatar_url":"https://github.com/palashmon.png","language":"JavaScript","readme":"# unique-objects ![CI](https://github.com/palashmon/unique-objects/actions/workflows/main.yml/badge.svg)\n\n\u003e Get unique objects from array of objects based on single/multiple keys.\n\n## Install\n\n```\n$ npm i unique-objects\n```\n\n## Usage\n\nThis can be helpful in cases where you need unique records based on a single key or multiple keys.\n\n```js\nconst uniqueObjects = require('unique-objects');\nconst users = [\n\t{ id: 1, username: 'bret' },\n\t{ id: 2, username: 'samantha' },\n\t{ id: 2, username: 'samantha' },\n\t{ id: 2, username: 'samantha2' },\n\t{ id: 3, username: 'elvis' },\n\t{ id: 3, username: 'elvis2' },\n\t{ id: 3, username: 'elvis2' }\n];\n\n// Get unique objects in the users array based on just id\nuniqueObjects(users, ['id']);\n\n//=\u003e Returns just 3 unique objects out of 7\n// [\n// \t{ \"id\": 1, \"username\": \"bret\"},\n// \t{ \"id\": 2, \"username\": \"samantha2\"},\n// \t{ \"id\": 3, \"username\": \"elvis2\"},\n// ]\n\n// Get unique objects in the users array based on both id \u0026 username\nuniqueObjects(users, ['id', 'username']);\n\n//=\u003e Returns just 5 unique objects out of 7\n// [\n// \t{ \"id\": 1, \"username\": \"bret\"},\n// \t{ \"id\": 2, \"username\": \"samantha\"},\n// \t{ \"id\": 2, \"username\": \"samantha2\"},\n// \t{ \"id\": 3, \"username\": \"elvis\"},\n// \t{ \"id\": 3, \"username\": \"elvis2\"},\n// ]\n```\n\n## API\n\n### uniqueObjects(arrayInput, keys)\n\n#### arrayInput\n\nType: `Array`\u003cbr\u003e\nDefault: `[]`\n\nMust be a JavaScript Array. This is main array of object that we are going to process.\n\n#### keys\n\nType: `Array`\u003cbr\u003e\nDefault: `[]`\n\nMust be a JavaScript Array. This is the array of key(s) in the object that is used to find object is unique or not.\n\n## License\n\nMIT © [Palash Mondal](https://github.com/palashmon)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalashmon%2Funique-objects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalashmon%2Funique-objects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalashmon%2Funique-objects/lists"}