code: function isValidType(type, parent) {
    return (_.contains(_.values(xml2js.TYPEMAPS), type) ||
            _.has(xml2js.CLASSES, type) ||
            _.has(xml2js.ENUMS_BY_GROUP, type) ||
            _.contains(['Buffer', 'Function', 'mraa_result_t'], type) ||
            _.has((parent ? xml2js.CLASSES[parent].enums_by_group : []), type) ||
            isValidPointerType(type, parent));
  }
docs: verify whether the given type is valid JS