mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-20 05:41:27 +00:00
Rework architecture
This commit is contained in:
14
DiscordChatExporter.Domain/Internal/GenericExtensions.cs
Normal file
14
DiscordChatExporter.Domain/Internal/GenericExtensions.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace DiscordChatExporter.Domain.Internal
|
||||
{
|
||||
internal static class GenericExtensions
|
||||
{
|
||||
public static TOut Pipe<TIn, TOut>(this TIn input, Func<TIn, TOut> transform) => transform(input);
|
||||
|
||||
public static T? NullIf<T>(this T value, Func<T, bool> predicate) where T : struct =>
|
||||
!predicate(value)
|
||||
? value
|
||||
: (T?) null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user