{"id":18112665,"url":"https://github.com/bluefireteam/ordered_set","last_synced_at":"2025-10-06T16:30:28.324Z","repository":{"id":46048122,"uuid":"134971811","full_name":"bluefireteam/ordered_set","owner":"bluefireteam","description":"A simple implementation for an ordered set","archived":false,"fork":false,"pushed_at":"2025-05-21T15:50:12.000Z","size":139,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-23T12:41:30.308Z","etag":null,"topics":["collections","dart","flame","flutter","hacktoberfest","set"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/bluefireteam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"patreon":"bluefireoss"}},"created_at":"2018-05-26T15:13:46.000Z","updated_at":"2025-08-15T10:20:17.000Z","dependencies_parsed_at":"2023-09-23T05:12:22.186Z","dependency_job_id":"cad66d49-4ac8-45f3-9d0a-8835855ae8d6","html_url":"https://github.com/bluefireteam/ordered_set","commit_stats":{"total_commits":119,"total_committers":7,"mean_commits":17.0,"dds":"0.26890756302521013","last_synced_commit":"20d4ebe739c4e0df4c4d37d5820f774e31f48e89"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/bluefireteam/ordered_set","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluefireteam%2Fordered_set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluefireteam%2Fordered_set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluefireteam%2Fordered_set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluefireteam%2Fordered_set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluefireteam","download_url":"https://codeload.github.com/bluefireteam/ordered_set/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluefireteam%2Fordered_set/sbom","scorecard":{"id":244491,"data":{"date":"2025-08-11","repo":{"name":"github.com/bluefireteam/ordered_set","commit":"fbd14fd7f494f86c6aaf0e11e543d9446fcc0c54"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"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":"Code-Review","score":8,"reason":"Found 26/30 approved changesets -- score normalized to 8","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":"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":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/benchmark.yml:1","Warn: no topLevel permission defined: .github/workflows/cicd.yml:1","Warn: no topLevel permission defined: .github/workflows/title-validation.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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/benchmark.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/benchmark.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/benchmark.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/benchmark.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/benchmark.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/benchmark.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cicd.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cicd.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cicd.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cicd.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cicd.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cicd.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cicd.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cicd.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cicd.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/cicd.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/title-validation.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/bluefireteam/ordered_set/title-validation.yml/main?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   8 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":"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":"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":"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":"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":"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":"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 27 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"}}]},"last_synced_at":"2025-08-17T07:18:51.787Z","repository_id":46048122,"created_at":"2025-08-17T07:18:51.787Z","updated_at":"2025-08-17T07:18:51.787Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278643227,"owners_count":26021061,"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-06T02:00:05.630Z","response_time":65,"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":["collections","dart","flame","flutter","hacktoberfest","set"],"created_at":"2024-11-01T02:00:42.735Z","updated_at":"2025-10-06T16:30:28.319Z","avatar_url":"https://github.com/bluefireteam.png","language":"Dart","funding_links":["https://patreon.com/bluefireoss"],"categories":["Dart"],"sub_categories":[],"readme":"# ordered_set\n\n[![Pub Version](https://img.shields.io/pub/v/ordered_set)](https://pub.dev/packages/ordered_set)\n[![Build Status](https://github.com/flame-engine/flame/workflows/cicd/badge.svg?branch=main\u0026event=push)](https://github.com/bluefireteam/ordered_set/actions/workflows/cicd.yml)\n[![Coverage Status](https://coveralls.io/repos/github/bluefireteam/ordered_set/badge.svg?branch=main)](https://coveralls.io/github/bluefireteam/ordered_set?branch=main)\n\nA simple implementation for an Ordered Set for Dart.\n\nIt accepts either a comparator function that compares items for their priority or a mapper function\nthat maps items to their priority.\n\nUnlike Dart's [SplayTreeSet](https://api.dart.dev/dart-collection/SplayTreeSet-class.html) or\n[SplayTreeMap](https://api.dart.dev/dart-collection/SplayTreeMap-class.html) classes, it allows for\nseveral different elements with the same \"priority\" to be added.\n\nIt also implements [Iterable](https://api.dart.dev/dart-core/Iterable-class.html), allowing you to\niterate the contents (in order) in O(n) (no additional overhead).\n\n## Usage\n\nA simple usage example:\n\n```dart\n  import 'package:ordered_set/ordered_set.dart';\n\n  main() {\n    final items = OrderedSet.simple\u003cnum, int\u003e();\n    items.add(2);\n    items.add(1);\n    print(items.toList()); // [1, 2]\n  }\n```\n\nBut it can accept multiple items with the same priority:\n\n```dart\n  import 'package:ordered_set/ordered_set.dart';\n\n  main() {\n    final items = OrderedSet.mapping\u003cString, Person\u003e((p) =\u003e p.name);\n    items.add(Person('Alice', 'Engineering'));\n    items.add(Person('Bob', 'Accounting'));\n    items.add(Person('Alice', 'Marketing'));\n    print(items.toList()); // [Alice, Alice, Bob]\n  }\n```\n\n## Comparing\n\nIn order to assist the creation of `Comparator`s, the `Comparing` class can be used:\n\n```dart\n  // sort by name length\n  final people = OrderedSet.comparing\u003cPerson\u003e(Comparing.on((p) =\u003e p.name.length));\n\n  // sort by name desc\n  final people = OrderedSet.comparing\u003cPerson\u003e(Comparing.reverse(Comparing.on((p) =\u003e p.name)));\n\n  // sort by role and then by name\n  final people = OrderedSet.comparing\u003cPerson\u003e(Comparing.join([(p) =\u003e p.role, (p) =\u003e p.name]));\n```\n\nNote that you could instead just create a `MappingOrderedSet` instead:\n\n```dart\n  final people = OrderedSet.mapping\u003cnum, Person\u003e((p) =\u003e p.name.length);\n  // ...\n```\n\n## Mapping vs Comparing\n\nThere are two main implementations of the `OrderedSet` interface:\n\n* `ComparingOrderedSet`: the simplest implementation, takes in a `Comparator` and does not cache\n   priorities. It uses Dart's `SplayTreeSet` as a backing implementation.\n* `MappingOrderedSet`: a slightly more advanced implementation that takes in a mapper function\n   (maps elements to their priorities) and caches them. It uses Dart's `SplayTreeMap` as a backing\n   implementation.\n\nIn order to create an `OrderedSet`, however, you can just use the static methods on the interface\nitself:\n\n* `OrderedSet.comparing\u003cE\u003e([comparator])`: creates a `ComparingOrderedSet` with the given\n  `Comparator`.\n* `OrderedSet.mapping\u003cK, E\u003e([mapper])`: creates a `MappingOrderedSet` with the given mapper\n  function.\n* `OrderedSet.comparable\u003cK, E\u003e()`: if `E extends Comparable\u003cK\u003e`, this is a simpler way of creating\n  a `MappingOrderedSet` with identity mapping.\n* `OrderedSet.simple\u003cE\u003e()`: if `E extends Comparable\u003cE\u003e`, this is an even simpler way of creating\n  a `MappingOrderedSet` with identity mapping.\n\n## Querying\n\nYou can [register] a set of queries, i.e., predefined sub-types, whose results, i.e., subsets of\nthis set, are then cached. Since the queries have to be type checks, and types are runtime\nconstants, this can be vastly optimized.\n\nYou can then filter by type by using the [query] method (or using [whereType]; which is overridden).\n\nNote that you can change [strictMode] to allow for querying for unregistered types; if you do so,\nthe registration cost is payed on the first query.\n\n## Contributing\n\nAll contributions are very welcome! Please feel free to create Issues, help us with PR's or comment\nyour suggestions, feature requests, bugs, et cetera. Give us a star if you liked it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluefireteam%2Fordered_set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluefireteam%2Fordered_set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluefireteam%2Fordered_set/lists"}