Accepts an Array of ObjC return type and argument types (i.e. the result of
parse() below), and returns a new Array with the values mapped to valid ffi
types.
491871
function mapArray (types) {
  return types.map(function (type) {
    return Array.isArray(type) ? mapArray(type) : map(type)
  })
}
971011
function parseType (type) {
  var size
  var ret
  if (isArray(type)) {
    size = parseTypeArray(type)
    var subArray = type.slice(0, type.lastIndexOf('['))
    subArray = parseType(subArray)
    ret = {
      isArray: true,
      name: type,
      size: size,
      memoryUsage: size === 'dynamic' ? 32 : subArray.memoryUsage * size,
      subArray: subArray
    }
    return ret
  } else {
    var rawType
    switch (type) {
      case 'address':
        rawType = 'uint160'
        break
      case 'bool':
        rawType = 'uint8'
        break
      case 'string':
        rawType = 'bytes'
        break
    }
    ret = {
      rawType: rawType,
      name: type,
      memoryUsage: 32
    }

    if ((type.startsWith('bytes') && type !== 'bytes') || type.startsWith('uint') || type.startsWith('int')) {
      ret.size = parseTypeN(type)
    } else if (type.startsWith('ufixed') || type.startsWith('fixed')) {
      ret.size = parseTypeNxM(type)
    }

    if (type.startsWith('bytes') && type !== 'bytes' && (ret.size < 1 || ret.size > 32)) {
      throw new Error('Invalid bytes<N> width: ' + ret.size)
    }
    if ((type.startsWith('uint') || type.startsWith('int')) && (ret.size % 8 || ret.size < 8 || ret.size > 256)) {
      throw new Error('Invalid int/uint<N> width: ' + ret.size)
    }
    return ret
  }
}
578728
function convertStrItems2Obj(obj) {
	var result = {};
	for (var key in obj) {
		var val = obj[key];
		val = extractTypeAndCast(val);
		convertStrItem2Obj(key, val, result);
	}

	return result;
}
593813
function isTypedArray (obj) {
  if (typeof obj === 'object') {
    for (var i = 0; i < supportedDataTypes.length; i++) {
      if (obj instanceof supportedDataTypes[i]) {
        return true;
      }
    }
  }
}
343442
function type(value) {
  let valueType = typeof value;
  if (Array.isArray(value)) {
    valueType = 'array';
  } else if (value instanceof Date) {
    valueType = 'date';
  } else if (value === null) {
    valueType = 'null';
  }

  return valueType;
}
418294
function normalizeObjects(types) {
  var ret = types[0].type ? types[0].type : types[0];
  var args = types[1].map(function(item) { return item.type ? item.type : item; });
  return [ret, args];
 }
410839
def is_array_type(type_):
    

    array_types = _get_types(Types.ARRAY)
    if is_typing_type(type_):
        return type_ in array_types or (
            hasattr(type_, "__origin__") and type_.__origin__ in array_types
        )
    return type_ in array_types
1007185
public static Class[] convertToTypeArray(Object[] args) {
        if (args == null)
            return null;
        int s = args.length;
        Class[] ans = new Class[s];
        for (int i = 0; i < s; i++) {
            Object o = args[i];
            ans[i] = getClassWithNullAndWrapper(o);
        }
        return ans;
    }
380592
public static Object[] values( TypedArgument... arguments )
    {
        Object[] values = new Object[arguments.length];
        for ( int i = 0; i < values.length; i++ )
        {
            values[i] = arguments[i].value;
        }
        return values;
    }
489830
def parse_type_signature(sig):
    
    match = TYPE_SIG_RE.match(sig.strip())
    if not match:
        raise RuntimeError('Type signature invalid, got ' + sig)
    groups = match.groups()
    typ = groups[0]
    generic_types = groups[1]
    if not generic_types:
        generic_types = []
    else:
        generic_types = split_sig(generic_types[1:-1])
    is_array = (groups[2] is not None)
    return typ, generic_types, is_array
893777
function makeArray(obj) {
        var isArray;
        if ((isArray = Array.isArray)) {
            return isArray(obj) ? obj : [obj];
        }
        return ArrayPrototype.concat(obj);
    }
312828
@SuppressWarnings("unchecked")
	public static <E> TypeInformation<E[]> OBJECT_ARRAY(TypeInformation<E> elementType) {
		if (elementType == Types.STRING) {
			return (TypeInformation) BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO;
		}
		return ObjectArrayTypeInfo.getInfoFor(elementType);
	}
766724
function (obj, fn) {
        for (var i in obj) {
            if (typeof obj[i] === 'object') {
                obj[i] = parse(obj[i], fn);
            } else {
                obj[i] = fn(obj[i], i);
            }
        }
        return obj;
    }
959781
function checkArrayTypes() {
  var t, i;
  for (i = 0; i < arguments.length; i++) {
     if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')
       throw new TypeError('unexpected type ' + t + ', use Uint8Array');
  }
}
649924
function (instance, instanceKey, type, json, jsonKey) {
    var jsonObject = (jsonKey !== undefined) ? (json[jsonKey] || []) : json;
    var jsonArraySize = jsonObject.length;
    var conversionFunctionsList = [];
    var arrayInstance = [];
    instance[instanceKey] = arrayInstance;
    if (jsonArraySize > 0) {
        for (var i = 0; i < jsonArraySize; i++) {
            if (jsonObject[i]) {
                var typeName = getTypeNameFromInstance(type);
                if (!isSimpleType(typeName)) {
                    var typeInstance = new type();
                    conversionFunctionsList.push({ functionName: Constants.OBJECT_TYPE, instance: typeInstance, json: jsonObject[i] });
                    arrayInstance.push(typeInstance);
                }
                else {
                    arrayInstance.push(conversionFunctions[Constants.FROM_ARRAY](jsonObject[i], typeName));
                }
            }
        }
    }
    return conversionFunctionsList;
}
226423
function mapArray(type) {
		return Array.map(type, function(thing) {
			return isType(thing) ? parse(thing) : thing;
		});
	}
650355
function parse(obj, objType, stack) {
  			stack = stack || [];
  			var res,
  			    parser,
  			    parserType,
  			    objIndex = stack.indexOf(obj);

  			if (objIndex !== -1) {
  				return "recursion(" + (objIndex - stack.length) + ")";
  			}

  			objType = objType || this.typeOf(obj);
  			parser = this.parsers[objType];
  			parserType = typeof parser === "undefined" ? "undefined" : _typeof(parser);

  			if (parserType === "function") {
  				stack.push(obj);
  				res = parser.call(this, obj, stack);
  				stack.pop();
  				return res;
  			}
  			return parserType === "string" ? parser : this.parsers.error;
  		}