From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/web/static/src/js/tools/tools.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 addons/web/static/src/js/tools/tools.js (limited to 'addons/web/static/src/js/tools/tools.js') diff --git a/addons/web/static/src/js/tools/tools.js b/addons/web/static/src/js/tools/tools.js new file mode 100644 index 00000000..3df456de --- /dev/null +++ b/addons/web/static/src/js/tools/tools.js @@ -0,0 +1,22 @@ +odoo.define('web.tools', function (require) { +"use strict"; + +/** + * Wrapper for deprecated functions that display a warning message. + * + * @param {Function} fn the deprecated function + * @param {string} [message=''] optional message to display + * @returns {Function} + */ +function deprecated(fn, message) { + return function () { + console.warn(message || (fn.name + ' is deprecated.')); + return fn.apply(this, arguments); + }; +} + +return { + deprecated: deprecated, +}; + +}); -- cgit v1.2.3