vars method

ErrorType vars({
  1. List params = const [],
})

Implementation

ErrorType vars({List<dynamic> params = const []}) {

  if (params.isEmpty) {
    return ErrorType(value.trim());
  }

  String result = value.trim();

  for (int i = 0; i < params.length; i++) {
    result = result.replaceAll("{{$i}}", params[i].toString());
  }

  return ErrorType(result);
}