@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
20 lines • 630 B
JavaScript
function deprecationWarnings(className, props, deprecations) {
if (process.env.NODE_ENV === 'production') {
return;
}
for (const deprecation of deprecations) {
const {
property,
type = 'enabled by default',
description = '',
condition = () => true
} = deprecation;
if (props.hasOwnProperty(property)) {
if (condition(props)) {
// eslint-disable-next-line no-console
console.warn(`${property} property for ${className} is deprecated. ${description} [Will be ${type} in the next major editor-core version]`);
}
}
}
}
export default deprecationWarnings;