msl-server-node/mslMiddleware.js
function isFakeRespond(req) {
        var temp = req.url.toString();
        var uniqueID = md5(JSON.stringify(req.body));
        if (temp.indexOf("?") >= 0)
            req.url = reparsePath(temp);
        if (req.method === 'POST' && ((req.url in mockReqRespMap) && (mockReqRespMap[req.url] !== undefined)) &&
            ((!((req.url + uniqueID) in mockReqRespMap)) && (mockReqRespMap[req.url + uniqueID] === undefined))) {
            mockReqRespMap[req.url + uniqueID] = mockReqRespMap[req.url];
            delete mockReqRespMap[req.url];
            console.log('This is POST call, but we are mocking it as a GET method, please use setMockPOSTRespond function to mock the data!!');
        }
        if (((req.url in mockReqRespMap) && (mockReqRespMap[req.url] !== undefined)) ||
            ((req._parsedUrl.pathname in mockReqRespMap) && (mockReqRespMap[req._parsedUrl.pathname] !== undefined)) ||
            (((req.url + uniqueID) in mockReqRespMap) && (mockReqRespMap[req.url + uniqueID] !== undefined))) {
            return true;
        } else {
            return false;
        }
    }
function isFakeRespond(req) {
        var temp = req.url.toString();
        var uniqueID = md5(JSON.stringify(req.body));
        if (temp.indexOf("?") >= 0)
            req.url = reparsePath(temp);
        if (req.method === 'POST' && ((req.url in mockReqRespMap) && (mockReqRespMap[req.url] !== undefined)) &&
            ((!((req.url + uniqueID) in mockReqRespMap)) && (mockReqRespMap[req.url + uniqueID] === undefined))) {
            mockReqRespMap[req.url + uniqueID] = mockReqRespMap[req.url];
            delete mockReqRespMap[req.url];
            console.log('This is POST call, but we are mocking it as a GET method, please use setMockPOSTRespond function to mock the data!!');
        }
        if (((req.url in mockReqRespMap) && (mockReqRespMap[req.url] !== undefined)) ||
            ((req._parsedUrl.pathname in mockReqRespMap) && (mockReqRespMap[req._parsedUrl.pathname] !== undefined)) ||
            (((req.url + uniqueID) in mockReqRespMap) && (mockReqRespMap[req.url + uniqueID] !== undefined))) {
            return true;
        } else {
            return false;
        }
    }
function isFakeRespond ( req ) { var temp = req . url . toString ( ) ; var uniqueID = md5 ( JSON . stringify ( req . body ) ) ; if ( temp . indexOf ( "?" ) >= 0 ) req . url = reparsePath ( temp ) ; if ( req . method === 'POST' && ( ( req . url in mockReqRespMap ) && ( mockReqRespMap [ req . url ] !== undefined ) ) && ( ( ! ( ( req . url + uniqueID ) in mockReqRespMap ) ) && ( mockReqRespMap [ req . url + uniqueID ] === undefined ) ) ) { mockReqRespMap [ req . url + uniqueID ] = mockReqRespMap [ req . url ] ; delete mockReqRespMap [ req . url ] ; console . log ( 'This is POST call, but we are mocking it as a GET method, please use setMockPOSTRespond function to mock the data!!' ) ; } if ( ( ( req . url in mockReqRespMap ) && ( mockReqRespMap [ req . url ] !== undefined ) ) || ( ( req . _parsedUrl . pathname in mockReqRespMap ) && ( mockReqRespMap [ req . _parsedUrl . pathname ] !== undefined ) ) || ( ( ( req . url + uniqueID ) in mockReqRespMap ) && ( mockReqRespMap [ req . url + uniqueID ] !== undefined ) ) ) { return true ; } else { return false ; } }
Determines whether the request made by the path requires mock response by
checking mockReqRespMap.

@param req => XHR
@return true/false
Determines whether the request made by the path requires mock response by checking mockReqRespMap .