in appcenter-crashes/android/src/main/java/com/microsoft/appcenter/reactnative/crashes/RNUtils.java [18:43]
public static WritableMap convertJsonObjectToWritableMap(JSONObject jsonObj) throws JSONException {
WritableMap map = Arguments.createMap();
Iterator<String> it = jsonObj.keys();
while(it.hasNext()){
String key = it.next();
Object obj;
obj = jsonObj.get(key);
if (obj instanceof JSONObject)
map.putMap(key, convertJsonObjectToWritableMap((JSONObject) obj));
else if (obj instanceof JSONArray)
map.putArray(key, convertJsonArrayToWritableArray((JSONArray) obj));
else if (obj instanceof String)
map.putString(key, (String) obj);
else if (obj instanceof Double)
map.putDouble(key, (Double) obj);
else if (obj instanceof Integer)
map.putInt(key, (Integer) obj);
else if (obj instanceof Boolean)
map.putBoolean(key, (Boolean) obj);
else if (obj == null)
map.putNull(key);
else
throw new JSONException("Unrecognized object: " + obj);
}
return map;
}