{"id":17990990,"url":"https://github.com/oleksiyrudenko/stalin-sort","last_synced_at":"2025-03-25T23:31:52.942Z","repository":{"id":47543858,"uuid":"264642759","full_name":"OleksiyRudenko/stalin-sort","owner":"OleksiyRudenko","description":"A repressive sorting algorithm (not really sorting)","archived":false,"fork":false,"pushed_at":"2023-07-11T22:15:57.000Z","size":1564,"stargazers_count":13,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T01:37:04.630Z","etag":null,"topics":["algorithm","data-repression","educational-project","kottans","nodejs","npm-module","stalin-sort","stalinsort"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@rudenko/stalin-sort","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/OleksiyRudenko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2020-05-17T10:55:58.000Z","updated_at":"2023-09-10T11:01:38.000Z","dependencies_parsed_at":"2024-10-29T19:54:52.617Z","dependency_job_id":null,"html_url":"https://github.com/OleksiyRudenko/stalin-sort","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiyRudenko%2Fstalin-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiyRudenko%2Fstalin-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiyRudenko%2Fstalin-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiyRudenko%2Fstalin-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OleksiyRudenko","download_url":"https://codeload.github.com/OleksiyRudenko/stalin-sort/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245561862,"owners_count":20635828,"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":["algorithm","data-repression","educational-project","kottans","nodejs","npm-module","stalin-sort","stalinsort"],"created_at":"2024-10-29T19:19:50.208Z","updated_at":"2025-03-25T23:31:47.924Z","avatar_url":"https://github.com/OleksiyRudenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stalinSort\n\nInspired by [a post on mastodon](https://mastodon.social/@mathew/100958177234287431)\n\nDeveloped for educational purposes within [kottans](https://github.com/kottans)\n\n## Installation\n\n- npm: `npm install --save @rudenko/stalin-sort`\n- yarn: `yarn add @rudenko/stalin-sort`\n\n## Usage\n\n```javascript\nconst stalinSort = require('@rudenko/stalin-sort')\n\nconst numbers = [5, 2, 18, 1];\nconst strings = ['klm', 'nop', 'def', 'abc']\nlet result\n\ntry {\n  result = stalinSort(numbers) // [5, 18]\n} catch (e) {\n  // handle exception TypeError('Argument must be an array')\n}\n\ntry {\n  result = stalinSort(strings, (a, b) =\u003e a \u003e b) // ['klm', 'def', 'abc']\n} catch (e) {\n  // handle exceptions:\n  // - TypeError('Argument must be an array')\n  // - TypeError('Comparator must be a function')\n}\n```\n\nSee [`example.js`](./example.js) for more examples.\n\n## Educational\n\nAdvance from version to version to track the development process.\n\nSee also [CHANGELOG.md](./CHANGELOG.md)\n\n| Version | Milestone                       | Comment          | Diff\n| ------- | ------------------------------- | ---------------- | ---\n| 0.0.1   | Initialize project              |                  |\n| 0.0.2   | Add code stub and basic test    | Tests fail       | [v0.0.1...v0.0.2](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.0.1...v0.0.2)\n| 0.0.3   | Add positive scenarios test set | Tests still fail | [v0.0.2...v0.0.3](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.0.2...v0.0.3)\n| 0.1.0   | Add `for` loop implementation   | Tests succeed    | [v0.0.3...v0.1.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.0.3...v0.1.0)\n| 0.1.1   | Change implementation using `for...in` loop | Tests succeed    | [v0.1.0...v0.1.1](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.1.0...v0.1.1)\n| 0.1.2   | Change implementation using `for...of` loop | Tests succeed    | [v0.1.1...v0.1.2](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.1.1...v0.1.2)\n| 0.2.0   | Change implementation using `Array.forEach` | Tests succeed    | [v0.1.2...v0.2.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.1.2...v0.2.0)\n| 0.3.0   | Change implementation using `Array.reduce` | Tests succeed    | [v0.2.0...v0.3.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.2.0...v0.3.0)\n| 0.4.0   | Change implementation using `Array.filter` | Tests succeed    | [v0.3.0...v0.4.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.3.0...v0.4.0)\n| 0.4.1   | Change `Array.filter` condition (skip boolean literals) | Tests succeed    | [v0.4.0...v0.4.1](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.4.0...v0.4.1)\n| 0.4.2   | Change `Array.filter` condition (distill logic) | Tests succeed    | [v0.4.1...v0.4.2](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.4.1...v0.4.2)\n| 0.5.0   | Add error handling on wrong argument type | Tests succeed    | [v0.4.2...v0.5.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.4.2...v0.5.0)\n| 0.6.0   | Add `compare` argument and pre-defined comparators | Tests succeed    | [v0.5.0...v0.6.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.5.0...v0.6.0)\n| 0.7.0   | Add usage and `example.js`      | Tests succeed    | [v0.6.0...v0.7.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.6.0...v0.7.0)\n| 0.8.0   | Fix `stalinSort` implementation logical mistake    | Tests succeed    | [v0.7.0...v0.8.0](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.7.0...v0.8.0)\n| 0.8.1   | Add tests for comparison functions from `utils`    | Tests succeed    | [v0.8.0...v0.8.1](https://github.com/OleksiyRudenko/stalin-sort/compare/v0.8.0...v0.8.1)\n\n## Similar projects\n\n- [Joniator/stalinsort@github](https://github.com/Joniator/stalinsort)\n- [alvarocastro/stalinsort@github](https://github.com/alvarocastro/stalinsort)\n\n## Misc\n\nTime spent: apx 2hrs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleksiyrudenko%2Fstalin-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleksiyrudenko%2Fstalin-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleksiyrudenko%2Fstalin-sort/lists"}