mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 17:31:25 +08:00
4d1a998246
* add component param in warning * update snapshot
10 lines
281 B
TypeScript
10 lines
281 B
TypeScript
import warning from 'warning';
|
|
|
|
const warned: Record<string, boolean> = {};
|
|
export default (valid: boolean, component: string, message: string): void => {
|
|
if (!valid && !warned[message]) {
|
|
warning(false, `[antd: ${component}] ${message}`);
|
|
warned[message] = true;
|
|
}
|
|
};
|