evalLiteral method

  1. @protected
dynamic evalLiteral(
  1. Literal literal,
  2. Map<String, dynamic> context
)
inherited

Implementation

@protected
dynamic evalLiteral(
  Literal literal,
  Map<String, dynamic> context,
) {
  final value = literal.value;
  dynamic result = value;

  if (value is List) {
    result = value.map((e) => eval(e, context)).toList();
  } else if (value is Map) {
    result = value.map(
        (key, value) => MapEntry(eval(key, context), eval(value, context)));
  }
  return result;
}