Skip to content

Commit

Permalink
Add deprecation warning on Controller.param Function
Browse files Browse the repository at this point in the history
  • Loading branch information
tregagnon committed Aug 31, 2015
1 parent 50df4b1 commit 282f4a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
5 changes: 3 additions & 2 deletions lib/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var router = require('actionrouter')
, mime = require('express').static.mime
, utils = require('./utils')
, flatten = require('utils-flatten')
, deprecate = require('depd')('maglev')
, dispatch = require('./middleware/dispatch')
, ControllerError = require('./errors/controllererror');

Expand Down Expand Up @@ -46,9 +47,9 @@ function Controller() {
* @api public
*/
Controller.prototype.param =
Controller.prototype.params = function () {
Controller.prototype.params = deprecate.function(function () {
return this.__req.param.apply(this.__req, arguments);
};
}, 'this.param(s) should be replaced by direct access to req.params.property, req.query.property, or req.body.property');

/**
* Render response.
Expand Down
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,26 @@
"bugs": {
"url": "http://github.com/viadeo/maglev/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/MIT"
}
],
"license": "MIT",
"bin": {
"maglev": "./bin/maglev.js"
},
"main": "./lib",
"dependencies": {
"pkginfo": "0.3.0",
"commander": "2.7.1",
"co-prompt": "1.0.0",
"express": "4.12.3",
"actionrouter": "0.1.0",
"bootable": "0.2.4",
"bootable-environment": "0.2.0",
"parent-require": "1.0.0",
"co-prompt": "1.0.0",
"commander": "2.7.1",
"debug": "2.1.3",
"depd": "^1.0.1",
"express": "4.12.3",
"mkdirp": "0.3.5",
"parent-require": "1.0.0",
"pkginfo": "0.3.0",
"scripts": "0.1.0",
"utils-flatten": "1.0.0",
"syntax-error": "1.1.2",
"debug": "2.1.3"
"utils-flatten": "1.0.0"
},
"devDependencies": {
"chai": "2.x.x",
Expand Down

0 comments on commit 282f4a3

Please sign in to comment.