1 files changed, 13 insertions, 0 deletions
diff --git a/src/opcodes/instanceOf.ts b/src/opcodes/instanceOf.ts
new file mode 100644
index 00000000..b0c9bf26
--- /dev/null
+++ b/src/opcodes/instanceOf.ts
@@ -0,0 +1,13 @@
+import { instanceOf } from "lambert-server";
+import { CLOSECODES } from "../util/Constants";
+import WebSocket from "../util/WebSocket";
+
+export function check(this: WebSocket, schema: any, data: any) {
+ try {
+ return instanceOf(schema, data);
+ } catch (error) {
+ // invalid identify struct
+ this.close(CLOSECODES.Decode_error);
+ return false;
+ }
+}
|