2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Cleaning up core axios a bit

This commit is contained in:
mzabriskie
2015-01-23 02:11:57 -07:00
parent 9e3830cf92
commit bbf437ce4c
4 changed files with 57 additions and 32 deletions
+22
View File
@@ -0,0 +1,22 @@
'use strict';
/**
* Supply a warning to the developer that a method they are using
* has been deprecated.
*
* @param {string} method The name of the deprecated method
* @param {string} [instead] The alternate method to use if applicable
* @param {string} [docs] The documentation URL to get further details
*/
module.exports = function deprecatedMethod(method, instead, docs) {
try {
console.warn(
'DEPRECATED method `' + method + '`.' +
(instead ? ' Use `' + instead + '` instead.' : '') +
' This method will be removed in a future release.');
if (docs) {
console.warn('For more information about usage see ' + docs);
}
} catch (e) {}
};