doxy/node/xml2js.js
function getParams(spec_c, details, method, parent) {
  var spec_js = {};
  _.each(spec_c, function(param) {
    try {
      var paramType = getType(getText(getChild(param, 'type'), 'type'), parent);
      var paramName = getText(getChild(param, 'declname'), 'name');
      spec_js[paramName] = { type: paramType };
    } catch(e) {
      if (paramType == '...') {
        spec_js['arguments'] = { type: paramType };
      } else {
        throw e;
      }
    }
  });
  _.each(details, function(param) {
    var getParamName = function(p) { return getText(getChild(getChild(p, 'parameternamelist'), 'parametername'), 'name'); }
    var paramName = getParamName(param);
    var paramDescription = getText(getChild(param, 'parameterdescription'), 'description');
    if (_.has(spec_js, paramName)) {
      spec_js[paramName].description = paramDescription;
    } else {
      var msg = ' has documentation for an unknown parameter: ' + paramName + '. ';
      var suggestions = _.difference(_.keys(spec_js), _.map(details, getParamName));
      var msgAddendum = (!_.isEmpty(suggestions) ? ('Did you mean ' + suggestions.join(', or ') + '?') : '');
      console.log('Warning: ' + (parent ? (parent + '.') : '') + method + msg + msgAddendum);
    }
  });
  return spec_js;
}
function getParams(spec_c, details, method, parent) {
  var spec_js = {};
  _.each(spec_c, function(param) {
    try {
      var paramType = getType(getText(getChild(param, 'type'), 'type'), parent);
      var paramName = getText(getChild(param, 'declname'), 'name');
      spec_js[paramName] = { type: paramType };
    } catch(e) {
      if (paramType == '...') {
        spec_js['arguments'] = { type: paramType };
      } else {
        throw e;
      }
    }
  });
  _.each(details, function(param) {
    var getParamName = function(p) { return getText(getChild(getChild(p, 'parameternamelist'), 'parametername'), 'name'); }
    var paramName = getParamName(param);
    var paramDescription = getText(getChild(param, 'parameterdescription'), 'description');
    if (_.has(spec_js, paramName)) {
      spec_js[paramName].description = paramDescription;
    } else {
      var msg = ' has documentation for an unknown parameter: ' + paramName + '. ';
      var suggestions = _.difference(_.keys(spec_js), _.map(details, getParamName));
      var msgAddendum = (!_.isEmpty(suggestions) ? ('Did you mean ' + suggestions.join(', or ') + '?') : '');
      console.log('Warning: ' + (parent ? (parent + '.') : '') + method + msg + msgAddendum);
    }
  });
  return spec_js;
}
function getParams ( spec_c , details , method , parent ) { var spec_js = { } ; _ . each ( spec_c , function ( param ) { try { var paramType = getType ( getText ( getChild ( param , 'type' ) , 'type' ) , parent ) ; var paramName = getText ( getChild ( param , 'declname' ) , 'name' ) ; spec_js [ paramName ] = { type : paramType } ; } catch ( e ) { if ( paramType == '...' ) { spec_js [ 'arguments' ] = { type : paramType } ; } else { throw e ; } } } ) ; _ . each ( details , function ( param ) { var getParamName = function ( p ) { return getText ( getChild ( getChild ( p , 'parameternamelist' ) , 'parametername' ) , 'name' ) ; } var paramName = getParamName ( param ) ; var paramDescription = getText ( getChild ( param , 'parameterdescription' ) , 'description' ) ; if ( _ . has ( spec_js , paramName ) ) { spec_js [ paramName ] . description = paramDescription ; } else { var msg = ' has documentation for an unknown parameter: ' + paramName + '. ' ; var suggestions = _ . difference ( _ . keys ( spec_js ) , _ . map ( details , getParamName ) ) ; var msgAddendum = ( ! _ . isEmpty ( suggestions ) ? ( 'Did you mean ' + suggestions . join ( ', or ' ) + '?' ) : '' ) ; console . log ( 'Warning: ' + ( parent ? ( parent + '.' ) : '' ) + method + msg + msgAddendum ) ; } } ) ; return spec_js ; }
get paramater specs of a method
get paramater specs of a method