expectChar function
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"');
}
}