index.mjs 558 B

123456789101112131415
  1. import { debugWarn } from "../../utils/error.mjs";
  2. import { unref, watch } from "vue";
  3. //#region ../../packages/hooks/use-deprecated/index.ts
  4. const useDeprecated = ({ from, replacement, scope, version, ref, type = "API" }, condition) => {
  5. watch(() => unref(condition), (val) => {
  6. if (val) debugWarn(scope, `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.
  7. For more detail, please visit: ${ref}
  8. `);
  9. }, { immediate: true });
  10. };
  11. //#endregion
  12. export { useDeprecated };
  13. //# sourceMappingURL=index.mjs.map