expectChar function

void expectChar(
  1. String jsonPath,
  2. int index,
  3. String expected
)

Throws a FormatException if the character at the specified index in the

Implementation

void expectChar(String jsonPath, int index, String expected) {
  if (index >= jsonPath.length || jsonPath[index] != expected) {
    throw FormatException('Expected "$expected"');
  }
}