getSingleChildOrNull method

Parser? getSingleChildOrNull(
  1. String name
)

Implementation

Parser? getSingleChildOrNull(String name) {
  final result = getChildren(name);
  if (result.isEmpty) {
    return null;
  }
  if (result.length > 1) {
    throw ParsingException(
      name,
      null,
      'Multiple children found when one was expected',
    );
  }
  return result[0];
}