{"version":3,"file":"error.mjs","sources":["../../../../../packages/utils/error.ts"],"sourcesContent":["import { isString } from './types'\n\nclass XzxDesignError extends Error {\n  constructor(m: string) {\n    super(m)\n    this.name = 'XzxDesignError'\n  }\n}\n\nexport function throwError(scope: string, m: string): never {\n  throw new XzxDesignError(`[${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 XzxDesignError(`[${scope}] ${message}`)\n      : scope\n    // eslint-disable-next-line no-console\n    console.warn(error)\n  }\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,uBAAuB,KAAM,CAAA;AAAA,EACjC,YAAY,CAAW,EAAA;AACrB,IAAA,KAAA,CAAM,CAAC,CAAA,CAAA;AACP,IAAA,IAAA,CAAK,IAAO,GAAA,gBAAA,CAAA;AAAA,GACd;AACF,CAAA;AAEgB,SAAA,UAAA,CAAW,OAAe,CAAkB,EAAA;AAC1D,EAAA,MAAM,IAAI,cAAA,CAAe,CAAI,CAAA,EAAA,KAAA,CAAA,EAAA,EAAU,CAAG,CAAA,CAAA,CAAA,CAAA;AAC5C,CAAA;AAIgB,SAAA,SAAA,CAAU,OAAuB,OAAwB,EAAA;AACvE,EAAI,IAAA,OAAA,CAAQ,GAAI,CAAA,QAAA,KAAa,YAAc,EAAA;AACzC,IAAM,MAAA,KAAA,GAAe,SAAS,KAAK,CAAA,GAC/B,IAAI,cAAe,CAAA,CAAA,CAAA,EAAI,KAAU,CAAA,EAAA,EAAA,OAAA,CAAA,CAAS,CAC1C,GAAA,KAAA,CAAA;AAEJ,IAAA,OAAA,CAAQ,KAAK,KAAK,CAAA,CAAA;AAAA,GACpB;AACF;;;;"}