summaryrefslogtreecommitdiff
path: root/ws/mod.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ws/mod.ts')
-rw-r--r--ws/mod.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/ws/mod.ts b/ws/mod.ts
index df8cab01f..b649ef178 100644
--- a/ws/mod.ts
+++ b/ws/mod.ts
@@ -1,6 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { decode, encode } from "../strings/mod.ts";
+import { hasOwnProperty } from "../util/has_own_property.ts";
type Conn = Deno.Conn;
type Writer = Deno.Writer;
@@ -34,7 +35,7 @@ export interface WebSocketCloseEvent {
export function isWebSocketCloseEvent(
a: WebSocketEvent
): a is WebSocketCloseEvent {
- return typeof a === "object" && a.hasOwnProperty("code");
+ return hasOwnProperty(a, "code");
}
export type WebSocketPingEvent = ["ping", Uint8Array];