Skip to content
Myr

Add standard deprecation utility

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* deprecations ignore when NODE_ENV=test * uses node.js util.deprecate

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 6f9e927 · Browse files · 2 files+27 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+27 added−11 removed

  • other:+27 added−11 removed

2 files+27 added−11 removed

modified:lib/express.js+11 added-11 removed
modified:lib/utils.js+16 added
2 unmodified lines
3 * Module dependencies.4 */56var mime = require('connect').mime7 , deprecate = require('util').deprecate8 , crc32 = require('buffer-crc32');910/**11 * toString ref.
1 unmodified line
1314var toString = {}.toString;1516/**17 * Deprecate function, like core `util.deprecate`18 *19 * @param {Function} fn20 * @param {String} msg21 * @return {Function}22 * @api private23 */2425exports.deprecate = function(fn, msg){26 return 'test' !== process.env.NODE_ENV27 ? deprecate(fn, 'express: ' + msg)28 : fn;29};3031/**32 * Return ETag for `body`.33 *34 * @param {String|Buffer} body35 * @return {String}
295 unmodified lines