mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-03 00:29:20 +00:00
14 lines
408 B
C#
14 lines
408 B
C#
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;
|
|
}
|
|
} |