Skip to content

Commit

Permalink
Deprecate .jsonx()
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Nov 29, 2016
1 parent ddc22de commit cdcc3c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/hooks/responses/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ function _mixin_jsonx(req, res) {
*/
res.jsonx = res.jsonx || function jsonx (data){

var caller = jsonx.caller && jsonx.caller.name;

// Log a deprecation notice.
sails.log.debug('***********************************************************************************');
sails.log.debug('`res.jsonx()` is deprecated in Sails v1.0 and will be removed in a future release.');
sails.log.debug('Any files in api/responses that haven\'t been customized can simply be removed.');
sails.log.debug('Otherwise see http://sailsjs.com/upgrading for options to replace `res.jsonx()`.');
if (caller) {
sails.log.debug('(jsonx was called from `' + caller + '`)');
}
sails.log.debug('***********************************************************************************');

// Send conventional status message if no data was provided
// (see http://expressjs.com/api.html#res.send)
if (_.isUndefined(data)) {
Expand Down

0 comments on commit cdcc3c0

Please sign in to comment.