{"version":3,"file":"useDeprecatedCondition.mjs","sources":["../../../../src/composables/useDeprecatedCondition.ts"],"sourcesContent":["import { unref, Ref, getCurrentInstance } from 'vue'\n\nimport { isDev } from '../utils/env'\nimport { warn } from '../utils/console'\n\ntype DeprecationSource = 'slots' | 'props' | 'attrs'\n\nconst OPTIONS_LIST: Record<DeprecationSource, string> = {\n  props: 'prop',\n  attrs: 'prop',\n  slots: 'slot',\n}\n\nexport const useDeprecatedCondition = (\n  validators: (() => string | boolean | undefined)[],\n) => {\n  if (!isDev) { return undefined }\n\n  const instance = getCurrentInstance()\n\n  if (!instance) {\n    throw new Error('`useDeprecated` hook must be used only inside of setup function!')\n  }\n\n  validators.forEach((validator) => {\n    const message = validator()\n\n    if (typeof message === 'string') {\n      warn(`(${instance.type.name} component) ${message}`)\n    }\n  })\n}\n"],"names":[],"mappings":";;;AAaa,MAAA,yBAAyB,CACpC,eACG;AACH,MAAI,CAAC,OAAO;AAAS,WAAA;AAAA,EAAU;AAE/B,QAAM,WAAW;AAEjB,MAAI,CAAC,UAAU;AACP,UAAA,IAAI,MAAM,kEAAkE;AAAA,EACpF;AAEW,aAAA,QAAQ,CAAC,cAAc;AAChC,UAAM,UAAU;AAEZ,QAAA,OAAO,YAAY,UAAU;AAC/B,WAAK,IAAI,SAAS,KAAK,IAAI,eAAe,OAAO,EAAE;AAAA,IACrD;AAAA,EAAA,CACD;AACH;"}