transformToMPJSObject static method

dynamic transformToMPJSObject(
  1. dynamic obj
)

Implementation

static dynamic transformToMPJSObject(dynamic obj) {
  if (obj is Map && obj["clazz"] == "object") {
    return JSObject(obj["ref"]);
  } else if (obj is Map && obj["clazz"] == "array") {
    return JSArray(obj["ref"]);
  } else if (obj is Map && obj["clazz"] == "function") {
    return JSFunction(obj["ref"]);
  } else {
    return obj;
  }
}