vuestic-ui
Version:
Vue 3 UI Framework
23 lines (22 loc) • 659 B
JavaScript
import { getCurrentInstance } from "vue";
import { i as isDev } from "../utils/env.mjs";
import { w as warn } from "../utils/console.mjs";
const useDeprecatedCondition = (validators) => {
if (!isDev) {
return void 0;
}
const instance = getCurrentInstance();
if (!instance) {
throw new Error("`useDeprecated` hook must be used only inside of setup function!");
}
validators.forEach((validator) => {
const message = validator();
if (typeof message === "string") {
warn(`(${instance.type.name} component) ${message}`);
}
});
};
export {
useDeprecatedCondition as u
};
//# sourceMappingURL=useDeprecatedCondition.mjs.map