lib/sysrev/sysrevMeta.js
function(identifier) {
    identifier = identifier.replace(/[.+]/g, function(match) {
      return '\\' + match;
    });

    var re = new RegExp('^' + identifier + '.*', ['i']);
    var systemId;

    systemId = _.find(_.keys(_systems), function(system) { return system === identifier; });

    if (!systemId) {
      systemId = _.find(_.keys(_systems), function(system) { return re.test(system); });
    }

    if (!systemId) {
      systemId = _.find(_.keys(_systems), function(system) { return re.test(_systems[system].name); });
    }

    return systemId;
  }
function(identifier) {
    identifier = identifier.replace(/[.+]/g, function(match) {
      return '\\' + match;
    });

    var re = new RegExp('^' + identifier + '.*', ['i']);
    var systemId;

    systemId = _.find(_.keys(_systems), function(system) { return system === identifier; });

    if (!systemId) {
      systemId = _.find(_.keys(_systems), function(system) { return re.test(system); });
    }

    if (!systemId) {
      systemId = _.find(_.keys(_systems), function(system) { return re.test(_systems[system].name); });
    }

    return systemId;
  }
function ( identifier ) { identifier = identifier . replace ( / [.+] / g , function ( match ) { return '\\' + match ; } ) ; var re = new RegExp ( '^' + identifier + '.*' , [ 'i' ] ) ; var systemId ; systemId = _ . find ( _ . keys ( _systems ) , function ( system ) { return system === identifier ; } ) ; if ( ! systemId ) { systemId = _ . find ( _ . keys ( _systems ) , function ( system ) { return re . test ( system ) ; } ) ; } if ( ! systemId ) { systemId = _ . find ( _ . keys ( _systems ) , function ( system ) { return re . test ( _systems [ system ] . name ) ; } ) ; } return systemId ; }
convert identifier into full system guid using:
1) exact match on key
2) partial match on key
3) partial match on name
convert identifier into full system guid using : 1 ) exact match on key 2 ) partial match on key 3 ) partial match on name