Skip to content

Commit

Permalink
Merge pull request #55 from Tynab/develop
Browse files Browse the repository at this point in the history
v3.2.3
  • Loading branch information
Tynab authored Dec 3, 2023
2 parents f6d8718 + 7565296 commit b3f4e4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/YANLib/YANEnumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public static IEnumerable<string> Clean(this IEnumerable<string> srcs)
}
}

public static bool IsEmptyOrNull<T>([NotNullWhen(false)] this IEnumerable<T> srcs) => srcs is null || !srcs.Any();
public static bool IsEmptyOrNull<T>([NotNullWhen(false)] this IEnumerable<T>? srcs) => srcs is null || !srcs.Any();

public static bool IsEmptyOrNull<T>([NotNullWhen(false)] this ICollection<T> srcs) => srcs is null || srcs.Count < 1;
public static bool IsEmptyOrNull<T>([NotNullWhen(false)] this ICollection<T>? srcs) => srcs is null || srcs.Count < 1;

public static bool IsNotEmptyAndNull<T>([NotNullWhen(true)] this IEnumerable<T> srcs) => srcs is not null && srcs.Any();
public static bool IsNotEmptyAndNull<T>([NotNullWhen(true)] this IEnumerable<T>? srcs) => srcs is not null && srcs.Any();

public static bool IsNotEmptyAndNull<T>([NotNullWhen(true)] this ICollection<T> srcs) => srcs is not null && srcs.Count > 0;
public static bool IsNotEmptyAndNull<T>([NotNullWhen(true)] this ICollection<T>? srcs) => srcs is not null && srcs.Count > 0;

public static bool AllEmptyOrNull<T>(this IEnumerable<T?> srcs) where T : class => !srcs.Any(x => x is not null || x.AnyPropertiesNotDefault());

Expand Down
7 changes: 2 additions & 5 deletions lib/YANLib/YANLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@
<PackAsTool>False</PackAsTool>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>Update
- Text
- Char
- String</PackageReleaseNotes>
<PackageReleaseNotes>Hotfix Enumerable</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageId>Tynab.YANLib</PackageId>
<Version>3.2.2</Version>
<Version>3.2.3</Version>
<LangVersion>preview</LangVersion>
</PropertyGroup>

Expand Down

0 comments on commit b3f4e4d

Please sign in to comment.