| 147 | inline std::string optional_nullable_string(const Value & object, const std::string & key, std::string default_value) { |
| 148 | const auto * value = object.find(key); |
| 149 | if (value == nullptr || value->is_null()) { |
| 150 | return default_value; |
| 151 | } |
| 152 | return value->as_string(); |
| 153 | } |
| 154 | |
| 155 | template <typename T> |
| 156 | std::vector<T> number_array_as(const Value & value) { |
| 157 | std::vector<T> out; |
| 158 | out.reserve(value.as_array().size()); |
| 159 | for (const auto & item : value.as_array()) { |
no test coverage detected