lib/RouteInfo.js
function parseMethodName(parts, argsNames) {
    /**
     * argsName could be in different case from that
     * of function's name.
     */
    const argsNamesLower = argsNames.map(arg => arg.toLowerCase())
    /**
     * Suppresses HTTP method if exists
     */
    if(keysMethods.indexOf(parts[0].toLowerCase()) >= 0)
        parts = parts.slice(1)
    /**
     * Converts each method part into route path  
     */
    return parts.reduce((prev, curr) => {
        if(keywordsMaps[curr]) prev += keywordsMaps[curr] 
        else {
            if(prev.slice(-1) != '/') prev += '/'
            const index = argsNamesLower.indexOf(curr.toLowerCase())
            if(index >= 0) {
                prev += ':'
                prev += argsNames[index] // Preserve argument Case
            } else {
                prev += curr
            }
        }
        return prev
    }, '')
}
function parseMethodName(parts, argsNames) {
    /**
     * argsName could be in different case from that
     * of function's name.
     */
    const argsNamesLower = argsNames.map(arg => arg.toLowerCase())
    /**
     * Suppresses HTTP method if exists
     */
    if(keysMethods.indexOf(parts[0].toLowerCase()) >= 0)
        parts = parts.slice(1)
    /**
     * Converts each method part into route path  
     */
    return parts.reduce((prev, curr) => {
        if(keywordsMaps[curr]) prev += keywordsMaps[curr] 
        else {
            if(prev.slice(-1) != '/') prev += '/'
            const index = argsNamesLower.indexOf(curr.toLowerCase())
            if(index >= 0) {
                prev += ':'
                prev += argsNames[index] // Preserve argument Case
            } else {
                prev += curr
            }
        }
        return prev
    }, '')
}
function parseMethodName ( parts , argsNames ) { /**
     * argsName could be in different case from that
     * of function's name.
     */ const argsNamesLower = argsNames . map ( arg => arg . toLowerCase ( ) ) /**
     * Suppresses HTTP method if exists
     */ if ( keysMethods . indexOf ( parts [ 0 ] . toLowerCase ( ) ) >= 0 ) parts = parts . slice ( 1 ) /**
     * Converts each method part into route path  
     */ return parts . reduce ( ( prev , curr ) => { if ( keywordsMaps [ curr ] ) prev += keywordsMaps [ curr ] else { if ( prev . slice ( - 1 ) != '/' ) prev += '/' const index = argsNamesLower . indexOf ( curr . toLowerCase ( ) ) if ( index >= 0 ) { prev += ':' prev += argsNames [ index ] // Preserve argument Case
 } else { prev += curr } } return prev } , '' ) }
Returns the route path for the corresponding controller
method name.
Returns the route path for the corresponding controller method name .