src/services/state-router.js
function(nameParams) {
    if(nameParams && nameParams.match(/^[a-zA-Z0-9_\.]*\(.*\)$/)) {
      var npart = nameParams.substring(0, nameParams.indexOf('('));
      var ppart = Parameters( nameParams.substring(nameParams.indexOf('(')+1, nameParams.lastIndexOf(')')) );

      return {
        name: npart,
        params: ppart
      };

    } else {
      return {
        name: nameParams,
        params: null
      };
    }
  }
function(nameParams) {
    if(nameParams && nameParams.match(/^[a-zA-Z0-9_\.]*\(.*\)$/)) {
      var npart = nameParams.substring(0, nameParams.indexOf('('));
      var ppart = Parameters( nameParams.substring(nameParams.indexOf('(')+1, nameParams.lastIndexOf(')')) );

      return {
        name: npart,
        params: ppart
      };

    } else {
      return {
        name: nameParams,
        params: null
      };
    }
  }
function ( nameParams ) { if ( nameParams && nameParams . match ( / ^[a-zA-Z0-9_\.]*\(.*\)$ / ) ) { var npart = nameParams . substring ( 0 , nameParams . indexOf ( '(' ) ) ; var ppart = Parameters ( nameParams . substring ( nameParams . indexOf ( '(' ) + 1 , nameParams . lastIndexOf ( ')' ) ) ) ; return { name : npart , params : ppart } ; } else { return { name : nameParams , params : null } ; } }
Parse state notation name-params.

Assume all parameter values are strings

@param  {String} nameParams A name-params string
@return {Object}             A name string and param Object
Parse state notation name - params .