function transformSortingParams(req) {
	const sortingRegex = /(\w+)\+(ASC|DESC)/g; // perform a global search to match all the sort items

	if (req.query[starkQueryParam.SORT] && req.query[starkQueryParam.SORT].match(sortingRegex)) {
		const sortingParams = req.query[starkQueryParam.SORT].match(sortingRegex);

		var fields = [];
		var order = [];

		sortingParams.forEach(function (sortingParam) {
			fields.push(sortingParam.split("+")[0]);
			order.push(sortingParam.split("+")[1].toLowerCase());
		});

		req.query["_sort"] = fields.join(",");
		req.query["_order"] = order.join(",");

		delete req.query[starkQueryParam.SORT];
	}
}
/**
 * Replace Stark sorting params by JSON-server sorting params
 * @param req : The current request
 */
Replace Stark sorting params by JSON-server sorting params
@param req : The current request
Replace Stark sorting params by JSON - server sorting params @param req : The current request
function transformSortingParams(req) {
	const sortingRegex = /(\w+)\+(ASC|DESC)/g; 
	if (req.query[starkQueryParam.SORT] && req.query[starkQueryParam.SORT].match(sortingRegex)) {
		const sortingParams = req.query[starkQueryParam.SORT].match(sortingRegex);
		var fields = [];
		var order = [];
		sortingParams.forEach(function (sortingParam) {
			fields.push(sortingParam.split("+")[0]);
			order.push(sortingParam.split("+")[1].toLowerCase());
		});
		req.query["_sort"] = fields.join(",");
		req.query["_order"] = order.join(",");
		delete req.query[starkQueryParam.SORT];
	}
}
function transformSortingParams ( req ) { const sortingRegex = / (\w+)\+(ASC|DESC) / g ; if ( req . query [ starkQueryParam . SORT ] && req . query [ starkQueryParam . SORT ] . match ( sortingRegex ) ) { const sortingParams = req . query [ starkQueryParam . SORT ] . match ( sortingRegex ) ; var fields = [ ] ; var order = [ ] ; sortingParams . forEach ( function ( sortingParam ) { fields . push ( sortingParam . split ( "+" ) [ 0 ] ) ; order . push ( sortingParam . split ( "+" ) [ 1 ] . toLowerCase ( ) ) ; } ) ; req . query [ "_sort" ] = fields . join ( "," ) ; req . query [ "_order" ] = order . join ( "," ) ; delete req . query [ starkQueryParam . SORT ] ; } }
Replace Stark sorting params by JSON-server sorting params
 @param req : The current request
Replace Stark sorting params by JSON - server sorting params @param req : The current request
// perform a global search to match all the sort items