/Chasm

A set of utility and helper libraries that I'm developing and maintaining primary for myself.

Primary LanguageC#MIT LicenseMIT

Latest NuGet version Open issues Open PRs MIT License

A library designed for efficiently working with SemVer 2.0.0 versions and node-semver version ranges.

  • Focus on functionality and performance. I will make sure to implement any common manipulations with semantic versions, and I will microoptimize the hell out of everything! See the benchmarks. SemanticVersion, SemverPreRelease, SemverOptions, SemanticVersionBuilder, SemverComparer, SemverComparison.

  • Implements node-semver's version ranges. Notably, advanced comparators and wildcards (^1.2.x, ~5.3) are preserved as is, instead of being desugared into primitives like in all other libraries. That allows to interpret and manipulate version ranges more precisely. VersionRange, ComparatorSet, Comparator, PartialVersion, PartialComponent, PrimitiveComparator, AdvancedComparator, CaretComparator, HyphenRangeComparator, TildeComparator, XRangeComparator.

  • Operations with version ranges. Now this is definitely a unique feature - this library defines operations for Comparator, ComparatorSet and VersionRange. You can complement (~), union (|), intersect (&) and desugar ranges. Soon you'll also be able to normalize, transform and minimize ranges.

  • Default comparison ignores build metadata. I think it's more correct to have the default comparison be compliant with SemVer's specification. You can still do metadata-sensitive comparison using a custom comparer, if you want - SemverComparer.IncludeBuild.

  • Out-of-the-box serialization support. Supports serialization/deserialization with Newtonsoft.Json, System.Text.Json and System.Xml (and any libraries using TypeConverters) with no extra configuration needed.

  • Thoroughly tested, 100% code coverage. All of the library's functionality has been covered by tests. There may be some really obscure edge cases that haven't been covered, if you encounter them, file an issue here!

  • .NET-style documentation. Written in the style of System namespace docs. I don't know if it's worth advertising, but I really like how descriptive and consistent it is, so I thought I should mention that.

See more information and examples in the project's README.

Latest NuGet version MIT License

Provides various collection-related extension and utility methods:

  • ArrayExtensions - extension versions of most static methods in the Array class, and some more.
  • CollectionExtensions - some extensions for lists of tuples and key-value pairs.
  • EnumerableExtensions - a couple of extensions for enumerables.
  • Methods for returning empty read-only collections/enumerators/dictionaries (ReadOnlyCollection.Empty<T>()).

Latest NuGet version MIT License

Provides various utility types and methods:

  • Util.Fail, Util.Catch, Util.Is, Util.With utility methods for shortening common branch code.
  • DelegateDisposable - a class for quickly and easily creating custom disposable objects.

Latest NuGet version MIT License

Provides various formatting and parsing utility types and methods:

  • SpanBuilder - for formatting complex deep objects without unnecessary memory allocations.
  • SpanParser - for fluently and efficiently parsing text.