1
>
/*---------------------------------------------------------------------------------------------
console.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { URI } from './uri.js';
7
>
8
>
export interface IRemoteConsoleLog {
9
>
type: string;
10
>
severity: string;
11
>
arguments: string;
12
>
}
13
>
14
>
export interface IStackArgument {
15
>
__$stack: string;
16
>
}
17
>
18
>
export interface IStackFrame {
19
>
uri: URI;
20
>
line: number;
21
>
column: number;
22
>
}
23
>
24
>
export function isRemoteConsoleLog(obj: unknown): obj is IRemoteConsoleLog {
25
const entry = obj as IRemoteConsoleLog;
26
27
return entry && typeof entry.type === 'string' && typeof entry.severity === 'string';
28
}
30
>
export function parse(entry: IRemoteConsoleLog): { args: any[]; stack?: string } {
31
const args: any[] = [];
32
let stack: string | undefined;