| 47 | } |
| 48 | |
| 49 | nlohmann::json Get(const nlohmann::json &obj, const std::string &key) { |
| 50 | if(obj.is_object() && obj.contains(key)) { |
| 51 | return obj[key]; |
| 52 | } else { |
| 53 | return nlohmann::json(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | const std::string GetString(const nlohmann::json &obj, const std::string &key, const std::string &def) { |
| 58 | if(obj.is_object() && obj.contains(key) && obj[key].is_string()) { |
no outgoing calls
no test coverage detected