Skip to content

Commit 6abb192

Browse files
committed
- changed WireValueType and MessageType to strings - added a default branch in expose switch
1 parent 9e1ef7f commit 6abb192

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/comlink.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ export function expose(obj: any, ep: Endpoint = self as any) {
330330
returnValue = undefined;
331331
}
332332
break;
333+
default:
334+
return;
333335
}
334336
} catch (value) {
335337
returnValue = { value, [throwMarker]: 0 };

src/protocol.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ export interface Endpoint extends EventSource {
3838
}
3939

4040
export const enum WireValueType {
41-
RAW,
42-
PROXY,
43-
THROW,
44-
HANDLER,
41+
RAW = 'RAW',
42+
PROXY = 'PROXY',
43+
THROW = 'THROW',
44+
HANDLER = 'HANDLER',
4545
}
4646

4747
export interface RawWireValue {
@@ -62,12 +62,12 @@ export type WireValue = RawWireValue | HandlerWireValue;
6262
export type MessageID = string;
6363

6464
export const enum MessageType {
65-
GET,
66-
SET,
67-
APPLY,
68-
CONSTRUCT,
69-
ENDPOINT,
70-
RELEASE,
65+
GET = 'GET',
66+
SET = 'SET',
67+
APPLY = 'APPLY',
68+
CONSTRUCT = 'CONSTRUCT',
69+
ENDPOINT = 'ENDPOINT',
70+
RELEASE = 'RELEASE',
7171
}
7272

7373
export interface GetMessage {

0 commit comments

Comments
 (0)