{"id":15882217,"url":"https://github.com/another-guy/peppermint","last_synced_at":"2025-10-30T04:15:08.909Z","repository":{"id":65414296,"uuid":"62938501","full_name":"another-guy/Peppermint","owner":"another-guy","description":"Sugarized C#","archived":false,"fork":false,"pushed_at":"2017-06-16T22:03:17.000Z","size":96,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T20:23:35.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/another-guy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-09T07:41:26.000Z","updated_at":"2016-11-18T00:16:41.000Z","dependencies_parsed_at":"2023-01-22T10:05:13.288Z","dependency_job_id":null,"html_url":"https://github.com/another-guy/Peppermint","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/another-guy%2FPeppermint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/another-guy%2FPeppermint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/another-guy%2FPeppermint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/another-guy%2FPeppermint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/another-guy","download_url":"https://codeload.github.com/another-guy/Peppermint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246763860,"owners_count":20829798,"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-10-06T04:02:04.059Z","updated_at":"2025-10-30T04:15:03.846Z","avatar_url":"https://github.com/another-guy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Synopsis\n\n[![Peppermint](https://github.com/another-guy/Peppermint/raw/master/Peppermint.png)](https://github.com/another-guy/Peppermint)\n\nProvides a bit of C# syntactic sugar\n\n## Code Example\n\nStringToEnumExtension:\n\n```cs\nenum MyEnum\n{\n  One = 1,\n  Two = 2\n}\n\nstring @string = \"One\";\nMyEnum value = @string.Parse\u003cMyEnum\u003e();\n```\n\nDictionaryExtensions:\n```cs\nIDictionary\u003cstring, object\u003e dict = null;\ndict = dict.NullToEmpty();\nvar size = dict.Count; // size == 0, no exception here.\n```\n\nIEnumerableExtensions:\n```\nnew int[] { 1, 2, 3, 4, 5 }\n\t.TakeProject(\n\t\titem =\u003e item % 2 == 0,\n\t\titem =\u003e $\"{item} Mississippi\"); // -\u003e  { \"2 Mississippi\", \"4 Mississippi\" }\n\t\t\n\t\t\nnew int[] { 1, 2, 3, 4, 5 }\n\t.SkipProject(\n\t\titem =\u003e item \u003e 2,\n\t\titem =\u003e $\"{item} Mississippi\"); // -\u003e  { \"1 Mississippi\", \"2 Mississippi\" }\n\t\t\nnew int[] { 1, 2 }\n\t.TakeProjectMany(\n\t\titem =\u003e item \u003c 2,\n\t\titem =\u003e new int[] { item, item, item }); // -\u003e  { 1, 1, 1 }\n\t\t\nnew int[] { 1, 2 }\n\t.SkipProjectMany(\n\t\titem =\u003e item \u003c 2,\n\t\titem =\u003e new int[] { item, item, item }); // -\u003e  { 2, 2, 2 }\n```\n\nArrayExtensions:\n```cs\nstring[] array = null;\narray = array.NullToEmpty();\nvar length = array.Length; // length == 0, no exception here.\n```\n\nListExtensions:\n```cs\nstring[] ints = new[] { \"Alice\", \"Bob\" };\nlist.SwapAt(0, 1); // Swaps items in place. The array is now []{ \"Bob\", \"Alice\" }\n```\n\nSequence:\n```cs\n// Other sequence types or even custom sequence generators can be used.\nvar integers = Sequence\n\t.WithoutDuplicates(Sequence.NaturalNumbers)\n\t.Take(5)\n\t.ToList(); // Results in a List\u003cint\u003e() { 1, 2, 3, 4, 5 }\n\n// Sequence start number and sequence step can be explicitly provided if necessary.\n```\n\n## Motivation\n\nSyntax sugar is syntax sugar: it's not a necessary thing per se but it can improve code quality.\n\n## Installation\n\nPeppermint is a available in a form of a NuGet package.\nFollow regular installation process to bring it to your project.\nhttps://www.nuget.org/packages/Peppermint/\n\n## Tests\n\nUnit tests are available in Peppermint.Tests project.\n\n## License\n\nThe code is distributed under the MIT license.\n\n## Reporting an Issue\n\nReporting an issue, proposing a feature, or asking a question are all great ways to improve software quality.\n\nHere are a few important things that package contributors will expect to see in a new born GitHub issue:\n* the relevant version of the package;\n* the steps to reproduce;\n* the expected result;\n* the observed result;\n* some code samples illustrating current inconveniences and/or proposed improvements.\n\n## Contributing\n\nContribution is the best way to improve any project!\n\n1. Fork it!\n2. Create your feature branch (```git checkout -b my-new-feature```).\n3. Commit your changes (```git commit -am 'Added some feature'```)\n4. Push to the branch (```git push origin my-new-feature```)\n5. Create new Pull Request\n\n...or follow steps described in a nice [fork guide](http://kbroman.org/github_tutorial/pages/fork.html) by Karl Broman\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanother-guy%2Fpeppermint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanother-guy%2Fpeppermint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanother-guy%2Fpeppermint/lists"}