mirror of
https://github.com/actions/runner.git
synced 2025-12-18 00:07:08 +00:00
23 lines
733 B
C#
23 lines
733 B
C#
using System;
|
|
using System.ComponentModel;
|
|
using GitHub.DistributedTask.Expressions;
|
|
|
|
namespace GitHub.DistributedTask.Pipelines.Expressions
|
|
{
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
public sealed class IsEmailNode : FunctionNode
|
|
{
|
|
protected sealed override Boolean TraceFullyRealized => false;
|
|
|
|
public static Int32 minParameters = 1;
|
|
public static Int32 maxParameters = 1;
|
|
|
|
protected sealed override Object EvaluateCore(EvaluationContext context)
|
|
{
|
|
// isEmail(value: string)
|
|
String value = Parameters[0].EvaluateString(context) ?? String.Empty;
|
|
return RegexUtility.IsMatch(value, WellKnownRegularExpressions.Email);
|
|
}
|
|
}
|
|
}
|