{"id":19433077,"url":"https://github.com/pariazar/uniqq","last_synced_at":"2025-06-17T09:35:01.263Z","repository":{"id":64999380,"uuid":"580534699","full_name":"pariazar/uniqq","owner":"pariazar","description":"Function that removes duplicates from multiple nested array.","archived":false,"fork":false,"pushed_at":"2023-05-29T08:10:23.000Z","size":59,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T04:06:15.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pariazar.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-20T20:00:52.000Z","updated_at":"2022-12-21T16:50:07.000Z","dependencies_parsed_at":"2025-01-08T22:47:57.476Z","dependency_job_id":null,"html_url":"https://github.com/pariazar/uniqq","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"f4e4e5f8464fdedf6d76fb4d6f00fdd08a6a73d4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pariazar/uniqq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Funiqq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Funiqq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Funiqq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Funiqq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pariazar","download_url":"https://codeload.github.com/pariazar/uniqq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pariazar%2Funiqq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260329114,"owners_count":22992831,"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","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":[],"created_at":"2024-11-10T14:38:26.726Z","updated_at":"2025-06-17T09:35:01.212Z","avatar_url":"https://github.com/pariazar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"uniqq\n====\nRemoves all duplicates from multiple nested array recursively.\n\nUsage\n=====\nFirst install using npm:\n\n    npm install uniqq\n    \n#### Array Object\n\ninput parameters:\u003c/br\u003eThen use it as follows:\n\n* `array` is the array to remove items from\n* `key` is the key of object with duplicate value \n\n```javascript\n\nconst removeDuplicates = require('uniqq');\nconst arrObj = [\n  { name: 'Leonor' },\n  { name: 'Esperanza' },\n  { name: 'Leonor' },\n  { name: 'Horacio' },\n  { name: 'Leonor' },\n  { name: 'Nicholas' },\n  { name: 'Leonor' }\n];\n\nconsole.log(removeDuplicates(arrObj, key = 'name'));\n\n//Prints:\n//\n//  [\n//   { name: 'Leonor' },\n//   { name: 'Esperanza' },\n//   { name: 'Horacio' },\n//   { name: 'Nicholas' }\n// ]\n//\n```\n\n\n#### Nested Array Object\n\nThis method remove all duplicate objects recursively base on object key \u003c/br\u003e Then use it as follows:\n\n```javascript\nconst removeDuplicates = require('uniqq');\nconst arr = [{ id: 1, title: 'technology lovers' }, { id: 2, title: 'geeks' }, { id: 2, title: 'geeks' }, { id: 1, title: 'musics' }, {\n    id: 4, jobs: [\n        { id: 1, title: 'chef' },\n        { id: 2, title: 'accountant' },\n        { id: 2, title: 'teacher' },\n        { id: 2, title: 'teacher' },\n        { id: 2, title: 'teacher' },\n    ], educations: [\n        { id: 1, title: 'software engineer' },\n        { id: 1, title: 'software engineer' },\n        { id: 2, title: 'data science' },\n        { id: 2, title: 'data science' },\n        { id: 2, title: 'data science' },\n        { id: 2, title: 'data science' },\n        { id: 54, title: 'data science' },\n        { id: 2, title: 'data science' },\n        {\n            fields: [\n                {\n                    main: [\n                        { id: 1, title: 'software engineer' },\n                        { id: 2, title: 'data science' },\n                        { id: 2, title: 'data science' },\n                        { id: 2, title: 'data science' },\n                        { id: 2, title: 'data science' }\n                    ]\n                }\n            ]\n        }\n    ]\n}];\n\nconsole.log(removeDuplicates(arr, 'title', true));\n\n//Prints:\n//\n//  [\n//     { id: 1, title: 'technology lovers' },\n//     { id: 2, title: 'geeks' },\n//     { id: 1, title: 'musics' },\n//     {\n//         id: 4,\n//         jobs: [\n//             { id: 1, title: 'chef' },\n//             { id: 2, title: 'accountant' },\n//             { id: 2, title: 'teacher' }\n//         ],\n//         educations: [\n//             { id: 1, title: 'software engineer' },\n//             { id: 2, title: 'data science' },\n//             {\n//                 fields: [\n//                     {\n//                         main: [\n//                             { id: 1, title: 'software engineer' },\n//                             { id: 2, title: 'data science' }\n//                         ]\n//                     }\n//                 ]\n//             }\n//         ]\n//     }\n// ]\n//\n```\n\nNote: if you don't want to remove duplicate objects recursively you can set nestedRemover parameter false as follow:\n\n```javascript\nremoveDuplicates(arr, 'title', false);\n```\n#### Array String\n\nThen use it as follows:\n\n```javascript\n\nconst removeDuplicates = require('uniqq');\nconst strArr = ['alex', 'william', 'martin', 'sara', 'sara', 'max'];\n\nconsole.log(removeDuplicates(strArr));\n\n//Prints:\n//\n//  'alex', 'william', 'martin', 'sara', 'max'\n//\n```\n\n#### Array Numbers\n\nThen use it as follows:\n\n```javascript\n\nconst removeDuplicates = require('uniqq');\nconst numberArr = [111, 22, 33, 44, 55, 66, 77, 88, 88, 99, 10, 10, 10, 10];\n\nconsole.log(removeDuplicates(numberArr));\n\n//Prints:\n//\n//  111, 22, 33, 44, 55, 66, 77, 88, 99, 10\n//\n```\n\n\n## Support\n  - [Bug Reports](https://github.com/hamedpa/uniqq/issues/)\n\n## Contributors\n\u003cp\u003e\nPull requests are always welcome! Please base pull requests against the main branch and follow the contributing guide.\n\nif your pull requests makes documentation changes, please update readme file.\n\u003c/p\u003e\n\n## License\n\nThis project is licensed under the terms of the\nMIT license","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpariazar%2Funiqq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpariazar%2Funiqq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpariazar%2Funiqq/lists"}