convertToDart function

dynamic convertToDart(
  1. dynamic value
)

A workaround to converting an object to a Dart.

Implementation

dynamic convertToDart(value) {
  /// Value types.
  if (value == null) return null;
  if (value is bool || value is num || value is DateTime || value is String) {
    return value;
  }

  /// JsArray.
  if (value is Iterable) return value.map(convertToDart).toList();
  return jsToMap(value);
}