Releases: feO2x/Light.GuardClauses
Releases · feO2x/Light.GuardClauses
Release list
15.0.0 .NET 10 and More Assertions
Light.GuardClauses 15.0.0
- new assertions: IsUuidVersion7, MustBeUuidVersion7, IsFinite, MustBeFinite, IsAscii, MustBeAscii, and MustHaveCountIn
- new numeric sign guards: MustBePositive, MustBeNegative, MustNotBePositive, MustNotBeNegative, and MustNotBeZero
- new dictionary key guards: MustContainKey and MustNotContainKey
- new collection content guards: MustNotContainNull and MustNotContainNullOrWhiteSpace
- new string inspection assertions: ContainsOnlyDigits, MustContainOnlyDigits, ContainsOnlyLettersOrDigits, MustContainOnlyLettersOrDigits, IsUpperCase, MustBeUpperCase, IsLowerCase, MustBeLowerCase, IsBase64, MustBeBase64, IsHexadecimal, MustBeHexadecimal, and MustNotContainWhiteSpace
- new stream capability guards: MustBeReadable, MustBeWritable, and MustBeSeekable
- new collection count guard: MustHaveSameCountAs
- expanded span and memory support for MustNotBeEmpty, MustHaveLength, MustHaveLengthIn, and MustNotBeEmptyOrWhiteSpace, plus DateTimeOffset support for MustBeUtc
- breaking: the modern package target was updated from .NET 8 to .NET 10; .NET Standard 2.0 and 2.1 remain supported
What's Changed
- Whitelist for Source Code Transformation by @feO2x in #134
- Source Code Transformation for .NET 8 by @feO2x in #136
- Repo Restructuring by @feO2x in #138
- Roslyn RS1038 Fix by @feO2x in #140
- Upgrade to .NET 10 by @feO2x in #142
- Documentation Restructuring by @feO2x in #144
- Additional assertions Juli 2026 by @feO2x in #146
- Numeric Sign Guards by @feO2x in #149
- Dictionary Keys Guards by @feO2x in #150
- Collection Content Guards by @feO2x in #152
- String Inspection Guards by @feO2x in #154
- Increase Code Coverage by @feO2x in #155
- Stream Guards by @feO2x in #157
- Collection Count Equality by @feO2x in #159
- test: increase coverage and quality by @feO2x in #160
- v15 preparations by @feO2x in #161
Full Changelog: v14.0.0...v15.0.0
14,0.0 Polyfill Compatibility
Light.GuardClauses 14.0.0
- Single-Source-File: use NET8_0_OR_GREATER instead of NET_8_0 to play nicely with newer .NET versions
- Breaking Change: Check.Contains(string, string, System.StringComparison) now exists in Light.GuardClauses.FrameworkExtensions to avoid conflict with other polyfill libraries
What's Changed
- fix: use NET8_0_OR_GREATER for ifdefs by @cdonnellytx in #130
- 💣 feat: play nice with PolyfillLib by @cdonnellytx in #131
Full Changelog: v13.1.0...v14.0.0
🚀 13.1.0 ImmutableArray<T> support
Light.GuardClauses 13.1.0
- new assertions for
ImmutableArray<T>:MustNotBeDefaultOrEmpty,MustHaveLength,MustHaveLengthIn,MustHaveMinimumLength,MustHaveMaximumLength - new dependency: System.Collections.Immutable
What's Changed
- Issue 114 must not be default or empty for immutable array by @feO2x in #115
- MustNotContain for immutable array by @feO2x in #122
- MustHaveLength for immutable array by @feO2x in #123
- Issue 118 must have length in for immutable array by @feO2x in #124
- MustContain for immutable array by @feO2x in #125
- MustHaveMaximumLength for immutable array by @feO2x in #126
- MustHaveMinimumLength for immutable array by @feO2x in #127
- Release 13.1.0 by @feO2x in #128
Full Changelog: v13.0.0...v13.1.0
13.0.0 Approximately file extension
Light.GuardClauses 13.0.0
- new assertions:
IsApproximately<T>,IsLessThanOrApproximately<T>,IsGreaterThanOrApproximately<T>,MustBeApproximately,MustNotBeApproximately,MustBeLessThanOrApproximately,MustBeGreaterThanOrApproximately,IsEmptyOrWhiteSpaceforSpan<T>andMemory<T>,IsFileExtension - email regex is now precompiled on .NET 8 and newer, the regex is compiled at runtime on .NET Standard 2.0 and 2.1
- breaking:
Throwclass is now located in new namespaceLight.GuardClauses.ExceptionFactory - breaking:
Throwmembers regarding spans now only supportReadOnlySpan<T>,inkeyword was removed for these members - breaking:
IsApproximatelynow uses less-than-or-equal-to operator (<=) instead of less-than operator (<) - breaking: Email regex is less strict and support additional patterns like domains with more than 3 letters (e.g. .info or .travel)
What's Changed
- Smaller files refactoring by @feO2x in #103
- IsEmptyOrWhiteSpace for Span and Memory by @feO2x in #106
- Optimize Email Regex by @feO2x in #107
- IsFileExtension and MustBeFileExtension by @feO2x in #108
- Updates to IsEmailAddress and MustBeEmailAddress by @feO2x in #109
- Refactor: Throw class is now in own namespace called ExceptionFactory by @feO2x in #110
- Generic IsApproximately and MustBeApproximately/MustNotBeApproximately by @feO2x in #111
- Generic IsLessThanOrApproximately/IsGreaterThanOrApproximately by @feO2x in #112
- v13.0.0 by @feO2x in #113
Full Changelog: v12.0.0...v13.0.0
12.0.0 Not Nothing
11.0.0 Native AOT
Light.GuardClauses 11.0.0
- Light.GuardClauses now targets .NET 8 and is AOT-compatible
- breaking: EnumInfo<T> no longer has the UnderlyingType property
- In AOT scenarios, avoid the Type-related assertions, they are marked with the DynamicallyAccessedMembersAttribute
10.3.0 - Range.For
Light.GuardClauses 10.3.0
11.0.0-preview1 Native AOT
Light.GuardClauses 11.0.0-preview1
- Light.GuardClauses now targets .NET 8 and is AOT-compatible
- breaking:
EnumInfo<T>no longer has theUnderlyingTypeproperty - In AOT scenarios, avoid the Type-related assertions, they are marked with the
DynamicallyAccessedMembersAttribute
10.2.0 - Trimmed Strings and Approximate Floats
Light.GuardClauses 10.2.0
- Added
IsLessThanOrApproximatelyandIsGreaterThanOrApproximatelyassertions for doubles and floats - Added
IsTrimmedXXXandMustBeTrimmedXXXassertions for strings
10.1.0 - Support for JetBrains' NoEnumerationAttribute
Light.GuardClauses 10.1.0
- added support for JetBrains'
NoEnumerationAttribute- many thanks to Chris Donnelly (#82)