parseFieldName function

String parseFieldName(
  1. String jsonPath,
  2. int index
)

Parses a field name from a JSON path expression.

Implementation

String parseFieldName(String jsonPath, int index) {
  final buffer = StringBuffer();
  while (index < jsonPath.length && isUnquotedFieldChar(jsonPath[index])) {
    buffer.write(jsonPath[index]);
    index++;
  }
  return buffer.toString();
}