UNPKG

924 BTypeScriptView Raw
1import { InternError } from '../types';
2import { Executor } from '../executors/Executor';
3export default class ErrorFormatter implements ErrorFormatterProperties {
4 readonly executor: Executor;
5 constructor(executor: Executor);
6 format(error: string | Error | InternError, options?: ErrorFormatOptions): string;
7 protected _getSource(tracepath: string): string;
8 protected _createDiff(actual: string, expected: string): string;
9 protected _createDiff(actual: object, expected: object): string;
10 protected _formatLine(data: {
11 func?: string;
12 source: string;
13 }): string;
14 protected _normalizeStackTrace(stack: string): string;
15 protected _processChromeTrace(lines: string[]): string[];
16 protected _processSafariTrace(lines: string[]): string[];
17}
18export interface ErrorFormatterProperties {
19 executor: Executor;
20}
21export interface ErrorFormatOptions {
22 space?: string;
23}