Skip to content

Commit bc2f076

Browse files
committed
minor tweaks
1 parent bbf1943 commit bc2f076

File tree

4 files changed

+2
-40
lines changed

4 files changed

+2
-40
lines changed

src/output/PreviewProxy.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ export class PreviewProxy {
3030
return new Promise((resolve, reject) => {
3131
const cmd_id = uid++
3232

33-
//console.log('resolve', resolve)
34-
//console.log('reject', reject)
3533
this.pending_cmds.set(cmd_id, { resolve, reject })
3634

3735
this.iframe.contentWindow!.postMessage({ action, cmd_id, args }, '*')

src/types.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,6 @@ export interface EditorProps {
88
readonly?: boolean
99
mode?: EditorMode
1010
}
11-
export type ConsoleLevel =
12-
| 'clear'
13-
| 'log'
14-
| 'info'
15-
| 'dir'
16-
| 'warn'
17-
| 'error'
18-
| 'table'
19-
| 'group'
20-
| 'unclonable'
21-
| 'assert'
22-
export interface CommandData {
23-
action: 'console' | 'cmd_error' | 'cmd_ok' | 'error' | 'unhandledrejection'
24-
args: string[]
25-
level: ConsoleLevel
26-
stack?: string
27-
label?: string
28-
count?: number
29-
}
3011
export interface EditorEmits {
3112
(e: 'change', code: string): void
3213
}

src/utils.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,3 @@ export function atou(base64: string): string {
3131
// https://base64.guru/developers/javascript/examples/unicode-strings
3232
return decodeURIComponent(escape(binary))
3333
}
34-
35-
export function parse(value: any = false) {
36-
value = value ?? false
37-
if (typeof value === 'object') {
38-
return Object.entries(value) as [string, any][]
39-
}
40-
return false
41-
}
42-
43-
export function word(total: number, singular: string, plural: string) {
44-
const choose = total > 1 ? plural : singular
45-
return `${total} ${choose}`
46-
}
47-
48-
export function isObject(value: any) {
49-
const type = typeof value
50-
return value != null && (type == 'object' || type == 'function')
51-
}

test/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const App = {
5959
previewTheme: previewTheme.value,
6060
editor: MonacoEditor,
6161
// layout: 'vertical',
62-
ssr: false,
62+
ssr: true,
63+
showConsole: true,
6364
sfcOptions: {
6465
script: {
6566
// inlineTemplate: false

0 commit comments

Comments
 (0)