@talend/react-bootstrap
Version:
Bootstrap 3 components built with React
40 lines (39 loc) • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports._resetWarned = _resetWarned;
exports.default = void 0;
var _warning = _interopRequireDefault(require("warning"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
let warned = {};
function deprecationWarning(oldname, newname, link) {
let message;
if (typeof oldname === 'object') {
message = oldname.message;
} else {
message = `${oldname} is deprecated. Use ${newname} instead.`;
if (link) {
message += `\nYou can read more about it at ${link}`;
}
}
if (warned[message]) {
return;
}
(0, _warning.default)(false, message);
warned[message] = true;
}
deprecationWarning.wrapper = (Component, ...args) => class DeprecatedComponent extends Component {
componentDidMount(...methodArgs) {
// eslint-disable-line
deprecationWarning(...args);
if (super.componentDidMount) {
super.componentDidMount(...methodArgs);
}
}
};
var _default = exports.default = deprecationWarning;
function _resetWarned() {
warned = {};
}
//# sourceMappingURL=deprecationWarning.js.map