| 487 | } |
| 488 | |
| 489 | std::pair<std::string, std::string> parseObjectPair(const nlohmann::json& object) { |
| 490 | if (!object.is_object()) { return {}; } |
| 491 | |
| 492 | auto iter = object.begin(); |
| 493 | if (iter == object.end()) { return {}; } |
| 494 | |
| 495 | std::string key = iter.key(); |
| 496 | std::string val = iter.value(); |
| 497 | |
| 498 | // make sure it's the only element |
| 499 | ++iter; |
| 500 | if (iter != object.end()) { return {}; } |
| 501 | |
| 502 | return {key, val}; |
| 503 | } |
| 504 | } // namespace chi |
no test coverage detected