Scriban.Helpers.ScriptTimeSpan.IScriptCustomType C# (CSharp) Method

IScriptCustomType() private method

private IScriptCustomType ( ScriptBinaryExpression expression, object left, object right ) : object
expression Scriban.Runtime.ScriptBinaryExpression
left object
right object
return object
        object IScriptCustomType.EvaluateBinaryExpression(ScriptBinaryExpression expression, object left, object right)
        {
            if (left is ScriptTimeSpan && right is ScriptTimeSpan)
            {
                return EvaluateBinaryExpression(expression, (ScriptTimeSpan) left, (ScriptTimeSpan) right);
            }

            if (left is ScriptTimeSpan && right is ScriptDate)
            {
                return EvaluateBinaryExpression(expression, (ScriptTimeSpan)left, (ScriptDate)right);
            }

            throw new ScriptRuntimeException(expression.Span, $"Operator [{expression.Operator}] is not supported for between [{left?.GetType()}] and [{right?.GetType()}]");
        }

Same methods

ScriptTimeSpan::IScriptCustomType ( Type destinationType, object &outValue ) : bool
ScriptTimeSpan::IScriptCustomType ( ScriptUnaryExpression expression ) : object