@leofcoin/peernet 1.1.71 → 1.1.73
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.
- package/exports/browser/browser-dc41c03f.js +187 -0
- package/exports/browser/client-f193279c.js +601 -0
- package/exports/browser/{index-2836cc96.js → index-81687e93.js} +1 -1
- package/exports/browser/index-fd97ecae.js +7875 -0
- package/exports/browser/{messages-554d2a85.js → messages-cccb78db.js} +1 -1
- package/exports/browser/{peernet-509d1c89.js → peernet-0298b289.js} +80 -293
- package/exports/browser/peernet.d.ts +1 -1
- package/exports/browser/peernet.js +1 -1
- package/exports/peernet.js +16 -2
- package/exports/types/peernet.d.ts +1 -1
- package/package.json +2 -3
- package/rollup.config.js +1 -8
- package/src/peernet.ts +16 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { g as getDefaultExportFromCjs } from './peernet-0298b289.js';
|
|
2
|
+
|
|
3
|
+
var global;
|
|
4
|
+
var hasRequiredGlobal;
|
|
5
|
+
|
|
6
|
+
function requireGlobal () {
|
|
7
|
+
if (hasRequiredGlobal) return global;
|
|
8
|
+
hasRequiredGlobal = 1;
|
|
9
|
+
var naiveFallback = function () {
|
|
10
|
+
if (typeof self === "object" && self) return self;
|
|
11
|
+
if (typeof window === "object" && window) return window;
|
|
12
|
+
throw new Error("Unable to resolve global `this`");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
global = (function () {
|
|
16
|
+
if (this) return this;
|
|
17
|
+
|
|
18
|
+
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
|
|
19
|
+
|
|
20
|
+
// Fallback to standard globalThis if available
|
|
21
|
+
if (typeof globalThis === "object" && globalThis) return globalThis;
|
|
22
|
+
|
|
23
|
+
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
|
|
24
|
+
// In all ES5+ engines global object inherits from Object.prototype
|
|
25
|
+
// (if you approached one that doesn't please report)
|
|
26
|
+
try {
|
|
27
|
+
Object.defineProperty(Object.prototype, "__global__", {
|
|
28
|
+
get: function () { return this; },
|
|
29
|
+
configurable: true
|
|
30
|
+
});
|
|
31
|
+
} catch (error) {
|
|
32
|
+
// Unfortunate case of updates to Object.prototype being restricted
|
|
33
|
+
// via preventExtensions, seal or freeze
|
|
34
|
+
return naiveFallback();
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
// Safari case (window.__global__ works, but __global__ does not)
|
|
38
|
+
if (!__global__) return naiveFallback();
|
|
39
|
+
return __global__;
|
|
40
|
+
} finally {
|
|
41
|
+
delete Object.prototype.__global__;
|
|
42
|
+
}
|
|
43
|
+
})();
|
|
44
|
+
return global;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var name = "websocket";
|
|
48
|
+
var description = "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.";
|
|
49
|
+
var keywords = [
|
|
50
|
+
"websocket",
|
|
51
|
+
"websockets",
|
|
52
|
+
"socket",
|
|
53
|
+
"networking",
|
|
54
|
+
"comet",
|
|
55
|
+
"push",
|
|
56
|
+
"RFC-6455",
|
|
57
|
+
"realtime",
|
|
58
|
+
"server",
|
|
59
|
+
"client"
|
|
60
|
+
];
|
|
61
|
+
var author = "Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)";
|
|
62
|
+
var contributors = [
|
|
63
|
+
"Iñaki Baz Castillo <ibc@aliax.net> (http://dev.sipdoc.net)"
|
|
64
|
+
];
|
|
65
|
+
var version$1 = "1.0.34";
|
|
66
|
+
var repository = {
|
|
67
|
+
type: "git",
|
|
68
|
+
url: "https://github.com/theturtle32/WebSocket-Node.git"
|
|
69
|
+
};
|
|
70
|
+
var homepage = "https://github.com/theturtle32/WebSocket-Node";
|
|
71
|
+
var engines = {
|
|
72
|
+
node: ">=4.0.0"
|
|
73
|
+
};
|
|
74
|
+
var dependencies = {
|
|
75
|
+
bufferutil: "^4.0.1",
|
|
76
|
+
debug: "^2.2.0",
|
|
77
|
+
"es5-ext": "^0.10.50",
|
|
78
|
+
"typedarray-to-buffer": "^3.1.5",
|
|
79
|
+
"utf-8-validate": "^5.0.2",
|
|
80
|
+
yaeti: "^0.0.6"
|
|
81
|
+
};
|
|
82
|
+
var devDependencies = {
|
|
83
|
+
"buffer-equal": "^1.0.0",
|
|
84
|
+
gulp: "^4.0.2",
|
|
85
|
+
"gulp-jshint": "^2.0.4",
|
|
86
|
+
"jshint-stylish": "^2.2.1",
|
|
87
|
+
jshint: "^2.0.0",
|
|
88
|
+
tape: "^4.9.1"
|
|
89
|
+
};
|
|
90
|
+
var config = {
|
|
91
|
+
verbose: false
|
|
92
|
+
};
|
|
93
|
+
var scripts = {
|
|
94
|
+
test: "tape test/unit/*.js",
|
|
95
|
+
gulp: "gulp"
|
|
96
|
+
};
|
|
97
|
+
var main = "index";
|
|
98
|
+
var directories = {
|
|
99
|
+
lib: "./lib"
|
|
100
|
+
};
|
|
101
|
+
var browser$3 = "lib/browser.js";
|
|
102
|
+
var license = "Apache-2.0";
|
|
103
|
+
var require$$0 = {
|
|
104
|
+
name: name,
|
|
105
|
+
description: description,
|
|
106
|
+
keywords: keywords,
|
|
107
|
+
author: author,
|
|
108
|
+
contributors: contributors,
|
|
109
|
+
version: version$1,
|
|
110
|
+
repository: repository,
|
|
111
|
+
homepage: homepage,
|
|
112
|
+
engines: engines,
|
|
113
|
+
dependencies: dependencies,
|
|
114
|
+
devDependencies: devDependencies,
|
|
115
|
+
config: config,
|
|
116
|
+
scripts: scripts,
|
|
117
|
+
main: main,
|
|
118
|
+
directories: directories,
|
|
119
|
+
browser: browser$3,
|
|
120
|
+
license: license
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var version = require$$0.version;
|
|
124
|
+
|
|
125
|
+
var _globalThis;
|
|
126
|
+
if (typeof globalThis === 'object') {
|
|
127
|
+
_globalThis = globalThis;
|
|
128
|
+
} else {
|
|
129
|
+
try {
|
|
130
|
+
_globalThis = requireGlobal();
|
|
131
|
+
} catch (error) {
|
|
132
|
+
} finally {
|
|
133
|
+
if (!_globalThis && typeof window !== 'undefined') { _globalThis = window; }
|
|
134
|
+
if (!_globalThis) { throw new Error('Could not determine global this'); }
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket;
|
|
139
|
+
var websocket_version = version;
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Expose a W3C WebSocket class with just one or two arguments.
|
|
144
|
+
*/
|
|
145
|
+
function W3CWebSocket(uri, protocols) {
|
|
146
|
+
var native_instance;
|
|
147
|
+
|
|
148
|
+
if (protocols) {
|
|
149
|
+
native_instance = new NativeWebSocket(uri, protocols);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
native_instance = new NativeWebSocket(uri);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
|
|
157
|
+
* class). Since it is an Object it will be returned as it is when creating an
|
|
158
|
+
* instance of W3CWebSocket via 'new W3CWebSocket()'.
|
|
159
|
+
*
|
|
160
|
+
* ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2
|
|
161
|
+
*/
|
|
162
|
+
return native_instance;
|
|
163
|
+
}
|
|
164
|
+
if (NativeWebSocket) {
|
|
165
|
+
['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) {
|
|
166
|
+
Object.defineProperty(W3CWebSocket, prop, {
|
|
167
|
+
get: function() { return NativeWebSocket[prop]; }
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Module exports.
|
|
174
|
+
*/
|
|
175
|
+
var browser = {
|
|
176
|
+
'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,
|
|
177
|
+
'version' : websocket_version
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
var browser$1 = /*@__PURE__*/getDefaultExportFromCjs(browser);
|
|
181
|
+
|
|
182
|
+
var browser$2 = /*#__PURE__*/Object.freeze({
|
|
183
|
+
__proto__: null,
|
|
184
|
+
default: browser$1
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
export { browser$2 as b };
|