MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / has_shape

Method has_shape

python-package/compile/src/io/json11.cpp:769–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

767 */
768
769bool Json::has_shape(const shape & types, string & err) const {
770 if (!is_object()) {
771 err = "Expected JSON object, got " + dump();
772 return false;
773 }
774
775 for (auto & item : types) {
776 if ((*this)[item.first].type() != item.second) {
777 err = "Bad type for " + item.first + " in " + dump();
778 return false;
779 }
780 }
781
782 return true;
783}
784
785} // namespace json11

Callers

nothing calls this directly

Calls 2

dumpFunction · 0.70
typeMethod · 0.45

Tested by

no test coverage detected