UNPKG

antui-mobile

Version:
24 lines (18 loc) 583 B
import warning from 'warning'; const warned = {}; export default function deprecationWarning(oldname, newname, link) { //avoid test warnings if (typeof global.it === 'function') { return; } const warnKey = `${oldname}\n${newname}`; if (warned[warnKey]) { return; } let message = `[AntUI-Mobile] ${oldname} is deprecated. Use ${newname} instead. ${oldname} will be remove in the next major version.`; if (link) { message += `\nYou can read more about it at \n${link}`; } warning(false, message); warned[warnKey] = true; }