{"version":3,"file":"error.mjs","sources":["../../../../packages/utils/error.ts"],"sourcesContent":["import { isString } from './types'\n\nclass MapSdkError extends Error {\n  constructor(m: string) {\n    super(m)\n    this.name = 'MapSdkError'\n  }\n}\n\nexport function throwError(scope: string, m: string): never {\n  throw new MapSdkError(`[${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 MapSdkError(`[${scope}] ${message}`)\n      : scope\n    // eslint-disable-next-line no-console\n    console.warn(error)\n  }\n}\n"],"names":["o","Error","constructor","n","super","this","name","throwError","r","debugWarn","process","env","NODE_ENV","e"],"mappings":"2DAAmC,MAAMA,UAAUC,MAAM,WAAAC,CAAYC,GAAGC,MAAMD,GAAGE,KAAKC,KAAK,aAAa,EAAS,SAASC,EAAWC,EAAEL,GAAG,MAAM,IAAIH,EAAE,IAAIQ,MAAML,IAAI,CAAQ,SAASM,EAAUD,EAAEL,GAA6B,eAAvBO,QAAQC,IAAIC,UAAiCC,EAAEL,IAAG,IAAIR,EAAE,IAAIQ,MAAML,IAAuB"}