toVoltronArray method

VoltronArray toVoltronArray()

Implementation

VoltronArray toVoltronArray() {
  var voltronArray = VoltronArray();
  for (var element in this) {
    if (element is Map) {
      voltronArray.push(element.toVoltronMap());
    } else if (element is List) {
      voltronArray.push(element.toVoltronArray());
    } else if (element is VoltronMap) {
      voltronArray.push(element.toDeepVoltronMap());
    } else if (element is VoltronArray) {
      voltronArray.push(element.toDeepVoltronArray());
    } else if (element is bool || element is String || element is num) {
      voltronArray.push(element);
    } else {
      throw 'type: ${element.runtimeType} is not support';
    }
  }
  return voltronArray;
}