objFromMap<T> static method

T? objFromMap<T>(
  1. dynamic data,
  2. T? returner(
    1. dynamic
    )
)

Implementation

static T? objFromMap<T>(dynamic data, T? Function(dynamic) returner) {
  if (data == null) {
    return null;
  }
  try {
    return returner(data);
  } catch (e, s) {
    if (Strapi.i.verbose) {
      sPrint("error while parsing strapi object");
      sPrint(e);
      sPrint(s);
    } else {
      sPrint(
          "ignoring a error while parsing a strapi object, set verbose to true to see the error");
    }
  }
}