element-plus
Version:
A Component Library for Vue 3
1 lines • 1.11 kB
Source Map (JSON)
{"version":3,"file":"error.mjs","names":[],"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"],"mappings":";;;AAEA,IAAM,mBAAN,cAA+B,MAAM;CACnC,YAAY,GAAW;AACrB,QAAM,EAAE;AACR,OAAK,OAAO;;;AAIhB,SAAgB,WAAW,OAAe,GAAkB;AAC1D,OAAM,IAAI,iBAAiB,IAAI,MAAM,IAAI,IAAI;;AAK/C,SAAgB,UAAU,OAAuB,SAAwB;CAC5B;EACzC,MAAM,QAAe,SAAS,MAAM,GAChC,IAAI,iBAAiB,IAAI,MAAM,IAAI,UAAU,GAC7C;AAEJ,UAAQ,KAAK,MAAM"}