{"version":3,"file":"index.cjs","sources":["../../../src/utils/error.ts"],"sourcesContent":["import { PKG_CAMELCASE_NAME } from '@mercurials/constants'\nimport { isString } from './types'\n\nclass ComponentError extends Error {\n  constructor(m: string) {\n    super(m)\n    this.name = `${PKG_CAMELCASE_NAME}Error`\n  }\n}\n\nexport function throwError(scope: string, m: string): never {\n  throw new ComponentError(`[${scope}] ${m}`)\n}\n\nexport function debugWarn(err: Error): void\nexport function debugWarn(scope: string, message: string): void\nexport function debugWarn(scope: string | Error, message?: string): void {\n  if (process.env.NODE_ENV !== 'production') {\n    const error: Error = isString(scope)\n      ? new ComponentError(`[${scope}] ${message}`)\n      : scope\n\n    console.warn(error)\n  }\n}\n"],"names":["ComponentError","m","PKG_CAMELCASE_NAME","debugWarn","scope","message","error","isString"],"mappings":"8LAGA,MAAMA,UAAuB,KAAM,CACjC,YAAYC,EAAW,CACrB,MAAMA,CAAC,EACP,KAAK,KAAO,GAAGC,EAAA,yBACjB,CACF,CAQgB,SAAAC,EAAUC,EAAuBC,EAAwB,CACnE,GAAA,QAAQ,IAAI,WAAa,aAAc,CACnC,MAAAC,EAAeC,WAASH,CAAK,EAC/B,IAAIJ,EAAe,IAAII,MAAUC,GAAS,EAC1CD,EAEJ,QAAQ,KAAKE,CAAK,CACpB,CACF"}