Files
starface-outlook-sync-addin/node_modules/@fluentui/utilities/lib/warn/warnDeprecations.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

25 lines
1.0 KiB
JavaScript

import { warn } from './warn';
/**
* Warns when a deprecated props are being used.
*
* @public
* @param componentName - The name of the component being used.
* @param props - The props passed into the component.
* @param deprecationMap - The map of deprecations, where key is the prop name and the value is
* either null or a replacement prop name.
*/
export function warnDeprecations(componentName, props, deprecationMap) {
if (process.env.NODE_ENV !== 'production') {
for (var propName in deprecationMap) {
if (props && propName in props) {
var deprecationMessage = "".concat(componentName, " property '").concat(propName, "' was used but has been deprecated.");
var replacementPropName = deprecationMap[propName];
if (replacementPropName) {
deprecationMessage += " Use '".concat(replacementPropName, "' instead.");
}
warn(deprecationMessage);
}
}
}
}
//# sourceMappingURL=warnDeprecations.js.map