transformToMPJSObject static method

dynamic transformToMPJSObject(
  1. dynamic obj
)

Implementation

static dynamic transformToMPJSObject(dynamic obj) {
  if (obj is js.JsArray) {
    return JSArray(obj);
  } else if (obj is js.JsFunction) {
    return JSFunction(obj);
  } else if (obj is Function) {
    return obj;
  } else if (obj is js.JsObject) {
    return JSObject(obj);
  } else if (obj is String || obj is num || obj is bool) {
    return obj;
  } else {
    return null;
  }
}