lib/factories/service.factory.js
function getServiceInfo(serviceName, adapterMap) {
        var serviceInfo = { serviceName: serviceName };
        var serviceParts = utils.splitCamelCase(serviceName);  // turn oneTwoThree into ['one', 'two', 'three']
        var nbrParts = serviceParts.length;

        // first check to see if the second to last part is an adapter
        serviceInfo.adapterName = serviceParts[nbrParts - 2];  // NOTE: last item in array is 'Service'
        if (adapterMap[serviceInfo.adapterName]) {
            serviceInfo.resourceName = serviceParts.slice(0, nbrParts - 2).join('.');
        }
        // if not, it means we are dealing with a straight service (ex. postService)
        else {
            serviceInfo.adapterName = 'service';
            serviceInfo.resourceName = serviceParts.slice(0, nbrParts - 1).join('.');
        }

        serviceInfo.adapterImpl = adapterMap[serviceInfo.adapterName];

        return serviceInfo;
    }
function getServiceInfo(serviceName, adapterMap) {
        var serviceInfo = { serviceName: serviceName };
        var serviceParts = utils.splitCamelCase(serviceName);  // turn oneTwoThree into ['one', 'two', 'three']
        var nbrParts = serviceParts.length;

        // first check to see if the second to last part is an adapter
        serviceInfo.adapterName = serviceParts[nbrParts - 2];  // NOTE: last item in array is 'Service'
        if (adapterMap[serviceInfo.adapterName]) {
            serviceInfo.resourceName = serviceParts.slice(0, nbrParts - 2).join('.');
        }
        // if not, it means we are dealing with a straight service (ex. postService)
        else {
            serviceInfo.adapterName = 'service';
            serviceInfo.resourceName = serviceParts.slice(0, nbrParts - 1).join('.');
        }

        serviceInfo.adapterImpl = adapterMap[serviceInfo.adapterName];

        return serviceInfo;
    }
function getServiceInfo ( serviceName , adapterMap ) { var serviceInfo = { serviceName : serviceName } ; var serviceParts = utils . splitCamelCase ( serviceName ) ; // turn oneTwoThree into ['one', 'two', 'three'] var nbrParts = serviceParts . length ; // first check to see if the second to last part is an adapter serviceInfo . adapterName = serviceParts [ nbrParts - 2 ] ; // NOTE: last item in array is 'Service' if ( adapterMap [ serviceInfo . adapterName ] ) { serviceInfo . resourceName = serviceParts . slice ( 0 , nbrParts - 2 ) . join ( '.' ) ; } // if not, it means we are dealing with a straight service (ex. postService) else { serviceInfo . adapterName = 'service' ; serviceInfo . resourceName = serviceParts . slice ( 0 , nbrParts - 1 ) . join ( '.' ) ; } serviceInfo . adapterImpl = adapterMap [ serviceInfo . adapterName ] ; return serviceInfo ; }
Figure out information about the service based on the module path and the adapter map

@param serviceName
@param adapterMap
@returns {{}}
Figure out information about the service based on the module path and the adapter map