ant-design/components/_util/warning.tsx
2019-01-13 01:36:25 +08:00

10 lines
236 B
TypeScript

import warning from 'warning';
const warned: Record<string, boolean> = {};
export default (valid: boolean, message: string): void => {
if (!valid && !warned[message]) {
warning(false, message);
warned[message] = true;
}
};