src/parse-tree/actionWrapper.js
function createNamedVariables(route, action) {
    return function innerCreateNamedVariables(matchedPath) {
        var convertedArguments;
        var len = -1;
        var restOfArgs = slice(arguments, 1);
        var isJSONObject = !isArray(matchedPath);

        // A set uses a json object
        if (isJSONObject) {
            restOfArgs = [];
            convertedArguments = matchedPath;
        }

        // Could be an array of pathValues for a set operation.
        else if (isPathValue(matchedPath[0])) {
            convertedArguments = [];

            matchedPath.forEach(function(pV) {
                pV.path = convertPathToRoute(pV.path, route);
                convertedArguments[++len] = pV;
            });
        }

        // else just convert and assign
        else {
            convertedArguments =
                convertPathToRoute(matchedPath, route);
        }
        return action.apply(this, [convertedArguments].concat(restOfArgs));
    };
}
function createNamedVariables(route, action) {
    return function innerCreateNamedVariables(matchedPath) {
        var convertedArguments;
        var len = -1;
        var restOfArgs = slice(arguments, 1);
        var isJSONObject = !isArray(matchedPath);

        // A set uses a json object
        if (isJSONObject) {
            restOfArgs = [];
            convertedArguments = matchedPath;
        }

        // Could be an array of pathValues for a set operation.
        else if (isPathValue(matchedPath[0])) {
            convertedArguments = [];

            matchedPath.forEach(function(pV) {
                pV.path = convertPathToRoute(pV.path, route);
                convertedArguments[++len] = pV;
            });
        }

        // else just convert and assign
        else {
            convertedArguments =
                convertPathToRoute(matchedPath, route);
        }
        return action.apply(this, [convertedArguments].concat(restOfArgs));
    };
}
function createNamedVariables ( route , action ) { return function innerCreateNamedVariables ( matchedPath ) { var convertedArguments ; var len = - 1 ; var restOfArgs = slice ( arguments , 1 ) ; var isJSONObject = ! isArray ( matchedPath ) ; // A set uses a json object if ( isJSONObject ) { restOfArgs = [ ] ; convertedArguments = matchedPath ; } // Could be an array of pathValues for a set operation. else if ( isPathValue ( matchedPath [ 0 ] ) ) { convertedArguments = [ ] ; matchedPath . forEach ( function ( pV ) { pV . path = convertPathToRoute ( pV . path , route ) ; convertedArguments [ ++ len ] = pV ; } ) ; } // else just convert and assign else { convertedArguments = convertPathToRoute ( matchedPath , route ) ; } return action . apply ( this , [ convertedArguments ] . concat ( restOfArgs ) ) ; } ; }
Creates the named variables and coerces it into its
virtual type.

@param {Array} route - The route that produced this action wrapper
@private
Creates the named variables and coerces it into its virtual type .