crossws 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types = require('../shared/crossws.c0275b79.cjs');
3
+ const types = require('../shared/crossws.c13afbe7.cjs');
4
4
 
5
5
  const bun = types.defineWebSocketAdapter(
6
6
  (options = {}) => {
@@ -1,4 +1,4 @@
1
- import { d as defineWebSocketAdapter, M as Message, c as createCrossWS, P as Peer, t as toBufferLike } from '../shared/crossws.61d46dae.mjs';
1
+ import { d as defineWebSocketAdapter, M as Message, c as createCrossWS, P as Peer, t as toBufferLike } from '../shared/crossws.34cfc8d0.mjs';
2
2
 
3
3
  const bun = defineWebSocketAdapter(
4
4
  (options = {}) => {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types = require('../shared/crossws.c0275b79.cjs');
3
+ const types = require('../shared/crossws.c13afbe7.cjs');
4
4
  const index = require('../index.cjs');
5
5
 
6
6
  const cloudflare = types.defineWebSocketAdapter(
@@ -1,4 +1,4 @@
1
- import { d as defineWebSocketAdapter, M as Message, P as Peer, t as toBufferLike, c as createCrossWS } from '../shared/crossws.61d46dae.mjs';
1
+ import { d as defineWebSocketAdapter, M as Message, P as Peer, t as toBufferLike, c as createCrossWS } from '../shared/crossws.34cfc8d0.mjs';
2
2
  import { WSError } from '../index.mjs';
3
3
 
4
4
  const cloudflare = defineWebSocketAdapter(
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types = require('../shared/crossws.c0275b79.cjs');
3
+ const types = require('../shared/crossws.c13afbe7.cjs');
4
4
  const index = require('../index.cjs');
5
5
 
6
6
  const deno = types.defineWebSocketAdapter(
@@ -1,4 +1,4 @@
1
- import { d as defineWebSocketAdapter, M as Message, P as Peer, t as toBufferLike, c as createCrossWS } from '../shared/crossws.61d46dae.mjs';
1
+ import { d as defineWebSocketAdapter, M as Message, P as Peer, t as toBufferLike, c as createCrossWS } from '../shared/crossws.34cfc8d0.mjs';
2
2
  import { WSError } from '../index.mjs';
3
3
 
4
4
  const deno = defineWebSocketAdapter(
@@ -5,7 +5,7 @@ const websocket = require('../shared/crossws.2ed26345.cjs');
5
5
  const require$$0 = require('events');
6
6
  const require$$2 = require('http');
7
7
  const require$$1 = require('crypto');
8
- const types = require('../shared/crossws.c0275b79.cjs');
8
+ const types = require('../shared/crossws.c13afbe7.cjs');
9
9
  const index = require('../index.cjs');
10
10
  require('https');
11
11
  require('net');
@@ -3,7 +3,7 @@ import { v as validationExports, g as getDefaultExportFromCjs, e as extension$1,
3
3
  import require$$0 from 'events';
4
4
  import require$$2 from 'http';
5
5
  import require$$1 from 'crypto';
6
- import { d as defineWebSocketAdapter, M as Message, P as Peer, t as toBufferLike, c as createCrossWS } from '../shared/crossws.61d46dae.mjs';
6
+ import { d as defineWebSocketAdapter, M as Message, P as Peer, t as toBufferLike, c as createCrossWS } from '../shared/crossws.34cfc8d0.mjs';
7
7
  import { WSError } from '../index.mjs';
8
8
  import 'https';
9
9
  import 'net';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types = require('../shared/crossws.c0275b79.cjs');
3
+ const types = require('../shared/crossws.c13afbe7.cjs');
4
4
 
5
5
  var __defProp = Object.defineProperty;
6
6
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -1,4 +1,4 @@
1
- import { d as defineWebSocketAdapter, c as createCrossWS, M as Message, P as Peer, t as toBufferLike } from '../shared/crossws.61d46dae.mjs';
1
+ import { d as defineWebSocketAdapter, c as createCrossWS, M as Message, P as Peer, t as toBufferLike } from '../shared/crossws.34cfc8d0.mjs';
2
2
 
3
3
  var __defProp = Object.defineProperty;
4
4
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types = require('./shared/crossws.c0275b79.cjs');
3
+ const types = require('./shared/crossws.c13afbe7.cjs');
4
4
 
5
5
  class WSError extends Error {
6
6
  constructor(...args) {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { M as Message, P as Peer, c as createCrossWS, a as defineHooks, d as defineWebSocketAdapter } from './shared/crossws.61d46dae.mjs';
1
+ export { M as Message, P as Peer, c as createCrossWS, a as defineHooks, d as defineWebSocketAdapter } from './shared/crossws.34cfc8d0.mjs';
2
2
 
3
3
  class WSError extends Error {
4
4
  constructor(...args) {
@@ -26,7 +26,7 @@ function createCrossWS(opts = {}) {
26
26
  },
27
27
  // Adapter hook
28
28
  $callHook(name, ...args) {
29
- return opts.adapterHooks?.[name].apply(void 0, args);
29
+ return opts.adapterHooks?.[name]?.apply(void 0, args);
30
30
  }
31
31
  };
32
32
  }
@@ -28,7 +28,7 @@ function createCrossWS(opts = {}) {
28
28
  },
29
29
  // Adapter hook
30
30
  $callHook(name, ...args) {
31
- return opts.adapterHooks?.[name].apply(void 0, args);
31
+ return opts.adapterHooks?.[name]?.apply(void 0, args);
32
32
  }
33
33
  };
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crossws",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Cross-platform WebSocket Servers for Node.js, Deno, Bun and Cloudflare Workers",
5
5
  "repository": "unjs/crossws",
6
6
  "license": "MIT",
@@ -96,7 +96,7 @@
96
96
  "eslint-config-unjs": "^0.2.1",
97
97
  "h3": "^1.10.1",
98
98
  "jiti": "^1.21.0",
99
- "listhen": "^1.6.0",
99
+ "listhen": "^1.7.0",
100
100
  "prettier": "^3.2.4",
101
101
  "typescript": "^5.3.3",
102
102
  "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.33.0",