{"version":3,"file":"index.mjs","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":";;AAGA,MAAMA,UAAuB,MAAM;AAAA,EACjC,YAAYC,GAAW;AACrB,UAAMA,CAAC,GACP,KAAK,OAAO,GAAGC;AAAA,EACjB;AACF;AAQgB,SAAAC,EAAUC,GAAuBC,GAAwB;AACnE,MAAA,QAAQ,IAAI,aAAa,cAAc;AACnC,UAAAC,IAAeC,EAASH,CAAK,IAC/B,IAAIJ,EAAe,IAAII,MAAUC,GAAS,IAC1CD;AAEJ,YAAQ,KAAKE,CAAK;AAAA,EACpB;AACF;"}