UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 1.38 kB
{"version":3,"file":"error.mjs","sources":["../../../../packages/utils/error.ts"],"sourcesContent":["import { isString } from './types'\n\nclass ElementPlusError extends Error {\n constructor(m: string) {\n super(m)\n this.name = 'ElementPlusError'\n }\n}\n\nexport function throwError(scope: string, m: string): never {\n throw new ElementPlusError(`[${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 ElementPlusError(`[${scope}] ${message}`)\n : scope\n // eslint-disable-next-line no-console\n console.warn(error)\n }\n}\n"],"names":[],"mappings":";;AAEA,MAAM,yBAAyB,KAAA,CAAM;AAAA,EACnC,YAAY,CAAA,EAAW;AACrB,IAAA,KAAA,CAAM,CAAC,CAAA;AACP,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AAAA,EACd;AACF;AAEO,SAAS,UAAA,CAAW,OAAe,CAAA,EAAkB;AAC1D,EAAA,MAAM,IAAI,gBAAA,CAAiB,CAAA,CAAA,EAAI,KAAK,CAAA,EAAA,EAAK,CAAC,CAAA,CAAE,CAAA;AAC9C;AAIO,SAAS,SAAA,CAAU,OAAuB,OAAA,EAAwB;AACvE,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,EAAc;AACzC,IAAA,MAAM,KAAA,GAAe,QAAA,CAAS,KAAK,CAAA,GAC/B,IAAI,gBAAA,CAAiB,CAAA,CAAA,EAAI,KAAK,CAAA,EAAA,EAAK,OAAO,CAAA,CAAE,CAAA,GAC5C,KAAA;AAEJ,IAAA,OAAA,CAAQ,KAAK,KAAK,CAAA;AAAA,EACpB;AACF;;;;"}