Outlook_Addin_LLM/node_modules/@fluentui/utilities/lib/warn/warn.js

27 lines
739 B
JavaScript
Raw Normal View History

/* eslint-disable no-console */
var _warningCallback = undefined;
/**
* Sends a warning to console, if the api is present.
*
* @public
* @param message - Warning message.
*/
export function warn(message) {
if (_warningCallback && process.env.NODE_ENV !== 'production') {
_warningCallback(message);
}
else if (console && console.warn) {
console.warn(message);
}
}
/**
* Configures the warning callback. Passing in undefined will reset it to use the default
* console.warn function.
*
* @public
* @param warningCallback - Callback to override the generated warnings.
*/
export function setWarningCallback(warningCallback) {
_warningCallback = warningCallback;
}
//# sourceMappingURL=warn.js.map