mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-16 01:41:15 +08:00
15 lines
315 B
JavaScript
15 lines
315 B
JavaScript
import warning from 'warning'
|
|
|
|
const warned = {}
|
|
export default (valid, message, throwError) => {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (!valid && !warned[message]) {
|
|
warning(false, message)
|
|
warned[message] = true
|
|
if (throwError) {
|
|
throw Error(message)
|
|
}
|
|
}
|
|
}
|
|
}
|