2020-01-21 18:12:14 +00:00
|
|
|
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
|
2016-04-01 22:25:16 +00:00
|
|
|
// Node module: loopback-datasource-juggler
|
|
|
|
// This file is licensed under the MIT License.
|
|
|
|
// License text available at https://opensource.org/licenses/MIT
|
|
|
|
|
2016-08-22 19:55:22 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-02-26 10:15:31 +00:00
|
|
|
// A lightweight alternative to "depd" that works in the browser
|
|
|
|
module.exports = function depd(namespace) {
|
2018-12-07 14:54:29 +00:00
|
|
|
const warned = {};
|
2015-02-26 10:15:31 +00:00
|
|
|
return function deprecate(message) {
|
|
|
|
if (warned[message]) return;
|
|
|
|
warned[message] = true;
|
|
|
|
|
|
|
|
if (process.noDeprecation) {
|
|
|
|
return;
|
|
|
|
} else if (process.traceDeprecation) {
|
|
|
|
console.trace(namespace, 'deprecated', message);
|
|
|
|
} else {
|
|
|
|
console.warn(namespace, 'deprecated', message);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|