/*jslint node:true indent:2 */
'use strict';

module.exports = function (req, res, next) {

  function sendResponse(code, json) {
    return res.status(code).json(json);
  }

  function getSuccessCode() {
    return req.method === 'POST' ? 201 : 200;
  }

  res.jSend = function (data) {
    var payload = {
      status: 'success',
      data: (!data || req.method === 'DELETE' ) ? null : data
    };

    return sendResponse(getSuccessCode(), payload);
  };

  return next();
};

@@ -249,16 +249,125 @@
 0;%0A  %7D%0A%0A
+  function getSuccessResponseData(data) %7B%0A    return (!data %7C%7C req.method === 'DELETE' ) ? null : data;%0A  %7D%0A%0A
   res.jS
@@ -451,57 +451,36 @@
 ta: 
-(!data %7C%7C req.method === 'DELETE' ) ? null : 
+getSuccessResponseData(
 data
+)
 %0A   

Break out getSuccessResponseData function for clarity