ant-design/components/_util/warning.tsx

10 lines
236 B
TypeScript
Raw Normal View History

2019-01-12 22:19:38 +08:00
import warning from 'warning';
2019-01-12 19:22:06 +08:00
const warned: Record<string, boolean> = {};
export default (valid: boolean, message: string): void => {
if (!valid && !warned[message]) {
warning(false, message);
warned[message] = true;
}
};