ng-swagger-gen.js
function toEnumName(value) {
  var result = '';
  var wasLower = false;
  for (var i = 0; i < value.length; i++) {
    var c = value.charAt(i);
    var isLower = /[a-z]/.test(c);
    if (!isLower && wasLower) {
      result += '_';
    }
    result += c.toUpperCase();
    wasLower = isLower;
  }
  if (!isNaN(value[0])) {
    result = '_' + result;
  }
  result = result.replace(/[^\w]/g, '_');
  result = result.replace(/_+/g, '_');
  return result;
}
function toEnumName(value) {
  var result = '';
  var wasLower = false;
  for (var i = 0; i < value.length; i++) {
    var c = value.charAt(i);
    var isLower = /[a-z]/.test(c);
    if (!isLower && wasLower) {
      result += '_';
    }
    result += c.toUpperCase();
    wasLower = isLower;
  }
  if (!isNaN(value[0])) {
    result = '_' + result;
  }
  result = result.replace(/[^\w]/g, '_');
  result = result.replace(/_+/g, '_');
  return result;
}
function toEnumName ( value ) { var result = '' ; var wasLower = false ; for ( var i = 0 ; i < value . length ; i ++ ) { var c = value . charAt ( i ) ; var isLower = / [a-z] / . test ( c ) ; if ( ! isLower && wasLower ) { result += '_' ; } result += c . toUpperCase ( ) ; wasLower = isLower ; } if ( ! isNaN ( value [ 0 ] ) ) { result = '_' + result ; } result = result . replace ( / [^\w] / g , '_' ) ; result = result . replace ( / _+ / g , '_' ) ; return result ; }
Converts a given enum value into the enum name
Converts a given enum value into the enum name