@waku/core 0.0.26-678635e.0 → 0.0.26

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/bundle/base_protocol-pDODy0G6.js +260 -0
  3. package/bundle/{base_protocol-4bcf7514.js → browser-mTOOnVZp.js} +751 -381
  4. package/bundle/index-cmONXM-V.js +595 -0
  5. package/bundle/index.js +637 -1879
  6. package/bundle/lib/base_protocol.js +3 -3
  7. package/bundle/lib/message/version_0.js +3 -3
  8. package/bundle/lib/predefined_bootstrap_nodes.js +1 -1
  9. package/bundle/{version_0-2f1176e3.js → version_0-LQTFNC7k.js} +118 -11
  10. package/dist/.tsbuildinfo +1 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.js +2 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/lib/base_protocol.d.ts +3 -2
  15. package/dist/lib/base_protocol.js +12 -6
  16. package/dist/lib/base_protocol.js.map +1 -1
  17. package/dist/lib/connection_manager.d.ts +8 -4
  18. package/dist/lib/connection_manager.js +34 -12
  19. package/dist/lib/connection_manager.js.map +1 -1
  20. package/dist/lib/filter/index.js +8 -5
  21. package/dist/lib/filter/index.js.map +1 -1
  22. package/dist/lib/filterPeers.js.map +1 -1
  23. package/dist/lib/keep_alive_manager.d.ts +1 -0
  24. package/dist/lib/keep_alive_manager.js +6 -3
  25. package/dist/lib/keep_alive_manager.js.map +1 -1
  26. package/dist/lib/light_push/index.js +1 -2
  27. package/dist/lib/light_push/index.js.map +1 -1
  28. package/dist/lib/message/version_0.d.ts +7 -7
  29. package/dist/lib/message/version_0.js +5 -6
  30. package/dist/lib/message/version_0.js.map +1 -1
  31. package/dist/lib/metadata/index.d.ts +3 -0
  32. package/dist/lib/metadata/index.js +67 -0
  33. package/dist/lib/metadata/index.js.map +1 -0
  34. package/dist/lib/predefined_bootstrap_nodes.js.map +1 -1
  35. package/dist/lib/store/history_rpc.js.map +1 -1
  36. package/dist/lib/store/index.js +10 -11
  37. package/dist/lib/store/index.js.map +1 -1
  38. package/dist/lib/stream_manager.js.map +1 -1
  39. package/dist/lib/wait_for_remote_peer.js.map +1 -1
  40. package/dist/lib/waku.d.ts +4 -3
  41. package/dist/lib/waku.js +15 -6
  42. package/dist/lib/waku.js.map +1 -1
  43. package/package.json +127 -1
  44. package/src/index.ts +3 -1
  45. package/src/lib/base_protocol.ts +29 -7
  46. package/src/lib/connection_manager.ts +44 -13
  47. package/src/lib/filter/index.ts +18 -11
  48. package/src/lib/keep_alive_manager.ts +9 -3
  49. package/src/lib/light_push/index.ts +3 -4
  50. package/src/lib/message/version_0.ts +18 -10
  51. package/src/lib/metadata/index.ts +110 -0
  52. package/src/lib/store/index.ts +12 -13
  53. package/src/lib/waku.ts +19 -5
  54. package/bundle/browser-90197c87.js +0 -754
  55. package/bundle/index-27b91e3b.js +0 -31
  56. package/dist/lib/constants.d.ts +0 -4
  57. package/dist/lib/constants.js +0 -5
  58. package/dist/lib/constants.js.map +0 -1
  59. package/src/lib/constants.ts +0 -4
@@ -1,754 +0,0 @@
1
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
-
3
- function getDefaultExportFromCjs (x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
- }
6
-
7
- function getAugmentedNamespace(n) {
8
- if (n.__esModule) return n;
9
- var f = n.default;
10
- if (typeof f == "function") {
11
- var a = function a () {
12
- if (this instanceof a) {
13
- return Reflect.construct(f, arguments, this.constructor);
14
- }
15
- return f.apply(this, arguments);
16
- };
17
- a.prototype = f.prototype;
18
- } else a = {};
19
- Object.defineProperty(a, '__esModule', {value: true});
20
- Object.keys(n).forEach(function (k) {
21
- var d = Object.getOwnPropertyDescriptor(n, k);
22
- Object.defineProperty(a, k, d.get ? d : {
23
- enumerable: true,
24
- get: function () {
25
- return n[k];
26
- }
27
- });
28
- });
29
- return a;
30
- }
31
-
32
- var browser = {exports: {}};
33
-
34
- /**
35
- * Helpers.
36
- */
37
-
38
- var ms;
39
- var hasRequiredMs;
40
-
41
- function requireMs () {
42
- if (hasRequiredMs) return ms;
43
- hasRequiredMs = 1;
44
- var s = 1000;
45
- var m = s * 60;
46
- var h = m * 60;
47
- var d = h * 24;
48
- var w = d * 7;
49
- var y = d * 365.25;
50
-
51
- /**
52
- * Parse or format the given `val`.
53
- *
54
- * Options:
55
- *
56
- * - `long` verbose formatting [false]
57
- *
58
- * @param {String|Number} val
59
- * @param {Object} [options]
60
- * @throws {Error} throw an error if val is not a non-empty string or a number
61
- * @return {String|Number}
62
- * @api public
63
- */
64
-
65
- ms = function(val, options) {
66
- options = options || {};
67
- var type = typeof val;
68
- if (type === 'string' && val.length > 0) {
69
- return parse(val);
70
- } else if (type === 'number' && isFinite(val)) {
71
- return options.long ? fmtLong(val) : fmtShort(val);
72
- }
73
- throw new Error(
74
- 'val is not a non-empty string or a valid number. val=' +
75
- JSON.stringify(val)
76
- );
77
- };
78
-
79
- /**
80
- * Parse the given `str` and return milliseconds.
81
- *
82
- * @param {String} str
83
- * @return {Number}
84
- * @api private
85
- */
86
-
87
- function parse(str) {
88
- str = String(str);
89
- if (str.length > 100) {
90
- return;
91
- }
92
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
93
- str
94
- );
95
- if (!match) {
96
- return;
97
- }
98
- var n = parseFloat(match[1]);
99
- var type = (match[2] || 'ms').toLowerCase();
100
- switch (type) {
101
- case 'years':
102
- case 'year':
103
- case 'yrs':
104
- case 'yr':
105
- case 'y':
106
- return n * y;
107
- case 'weeks':
108
- case 'week':
109
- case 'w':
110
- return n * w;
111
- case 'days':
112
- case 'day':
113
- case 'd':
114
- return n * d;
115
- case 'hours':
116
- case 'hour':
117
- case 'hrs':
118
- case 'hr':
119
- case 'h':
120
- return n * h;
121
- case 'minutes':
122
- case 'minute':
123
- case 'mins':
124
- case 'min':
125
- case 'm':
126
- return n * m;
127
- case 'seconds':
128
- case 'second':
129
- case 'secs':
130
- case 'sec':
131
- case 's':
132
- return n * s;
133
- case 'milliseconds':
134
- case 'millisecond':
135
- case 'msecs':
136
- case 'msec':
137
- case 'ms':
138
- return n;
139
- default:
140
- return undefined;
141
- }
142
- }
143
-
144
- /**
145
- * Short format for `ms`.
146
- *
147
- * @param {Number} ms
148
- * @return {String}
149
- * @api private
150
- */
151
-
152
- function fmtShort(ms) {
153
- var msAbs = Math.abs(ms);
154
- if (msAbs >= d) {
155
- return Math.round(ms / d) + 'd';
156
- }
157
- if (msAbs >= h) {
158
- return Math.round(ms / h) + 'h';
159
- }
160
- if (msAbs >= m) {
161
- return Math.round(ms / m) + 'm';
162
- }
163
- if (msAbs >= s) {
164
- return Math.round(ms / s) + 's';
165
- }
166
- return ms + 'ms';
167
- }
168
-
169
- /**
170
- * Long format for `ms`.
171
- *
172
- * @param {Number} ms
173
- * @return {String}
174
- * @api private
175
- */
176
-
177
- function fmtLong(ms) {
178
- var msAbs = Math.abs(ms);
179
- if (msAbs >= d) {
180
- return plural(ms, msAbs, d, 'day');
181
- }
182
- if (msAbs >= h) {
183
- return plural(ms, msAbs, h, 'hour');
184
- }
185
- if (msAbs >= m) {
186
- return plural(ms, msAbs, m, 'minute');
187
- }
188
- if (msAbs >= s) {
189
- return plural(ms, msAbs, s, 'second');
190
- }
191
- return ms + ' ms';
192
- }
193
-
194
- /**
195
- * Pluralization helper.
196
- */
197
-
198
- function plural(ms, msAbs, n, name) {
199
- var isPlural = msAbs >= n * 1.5;
200
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
201
- }
202
- return ms;
203
- }
204
-
205
- /**
206
- * This is the common logic for both the Node.js and web browser
207
- * implementations of `debug()`.
208
- */
209
-
210
- function setup(env) {
211
- createDebug.debug = createDebug;
212
- createDebug.default = createDebug;
213
- createDebug.coerce = coerce;
214
- createDebug.disable = disable;
215
- createDebug.enable = enable;
216
- createDebug.enabled = enabled;
217
- createDebug.humanize = requireMs();
218
- createDebug.destroy = destroy;
219
-
220
- Object.keys(env).forEach(key => {
221
- createDebug[key] = env[key];
222
- });
223
-
224
- /**
225
- * The currently active debug mode names, and names to skip.
226
- */
227
-
228
- createDebug.names = [];
229
- createDebug.skips = [];
230
-
231
- /**
232
- * Map of special "%n" handling functions, for the debug "format" argument.
233
- *
234
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
235
- */
236
- createDebug.formatters = {};
237
-
238
- /**
239
- * Selects a color for a debug namespace
240
- * @param {String} namespace The namespace string for the debug instance to be colored
241
- * @return {Number|String} An ANSI color code for the given namespace
242
- * @api private
243
- */
244
- function selectColor(namespace) {
245
- let hash = 0;
246
-
247
- for (let i = 0; i < namespace.length; i++) {
248
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
249
- hash |= 0; // Convert to 32bit integer
250
- }
251
-
252
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
253
- }
254
- createDebug.selectColor = selectColor;
255
-
256
- /**
257
- * Create a debugger with the given `namespace`.
258
- *
259
- * @param {String} namespace
260
- * @return {Function}
261
- * @api public
262
- */
263
- function createDebug(namespace) {
264
- let prevTime;
265
- let enableOverride = null;
266
- let namespacesCache;
267
- let enabledCache;
268
-
269
- function debug(...args) {
270
- // Disabled?
271
- if (!debug.enabled) {
272
- return;
273
- }
274
-
275
- const self = debug;
276
-
277
- // Set `diff` timestamp
278
- const curr = Number(new Date());
279
- const ms = curr - (prevTime || curr);
280
- self.diff = ms;
281
- self.prev = prevTime;
282
- self.curr = curr;
283
- prevTime = curr;
284
-
285
- args[0] = createDebug.coerce(args[0]);
286
-
287
- if (typeof args[0] !== 'string') {
288
- // Anything else let's inspect with %O
289
- args.unshift('%O');
290
- }
291
-
292
- // Apply any `formatters` transformations
293
- let index = 0;
294
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
295
- // If we encounter an escaped % then don't increase the array index
296
- if (match === '%%') {
297
- return '%';
298
- }
299
- index++;
300
- const formatter = createDebug.formatters[format];
301
- if (typeof formatter === 'function') {
302
- const val = args[index];
303
- match = formatter.call(self, val);
304
-
305
- // Now we need to remove `args[index]` since it's inlined in the `format`
306
- args.splice(index, 1);
307
- index--;
308
- }
309
- return match;
310
- });
311
-
312
- // Apply env-specific formatting (colors, etc.)
313
- createDebug.formatArgs.call(self, args);
314
-
315
- const logFn = self.log || createDebug.log;
316
- logFn.apply(self, args);
317
- }
318
-
319
- debug.namespace = namespace;
320
- debug.useColors = createDebug.useColors();
321
- debug.color = createDebug.selectColor(namespace);
322
- debug.extend = extend;
323
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
324
-
325
- Object.defineProperty(debug, 'enabled', {
326
- enumerable: true,
327
- configurable: false,
328
- get: () => {
329
- if (enableOverride !== null) {
330
- return enableOverride;
331
- }
332
- if (namespacesCache !== createDebug.namespaces) {
333
- namespacesCache = createDebug.namespaces;
334
- enabledCache = createDebug.enabled(namespace);
335
- }
336
-
337
- return enabledCache;
338
- },
339
- set: v => {
340
- enableOverride = v;
341
- }
342
- });
343
-
344
- // Env-specific initialization logic for debug instances
345
- if (typeof createDebug.init === 'function') {
346
- createDebug.init(debug);
347
- }
348
-
349
- return debug;
350
- }
351
-
352
- function extend(namespace, delimiter) {
353
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
354
- newDebug.log = this.log;
355
- return newDebug;
356
- }
357
-
358
- /**
359
- * Enables a debug mode by namespaces. This can include modes
360
- * separated by a colon and wildcards.
361
- *
362
- * @param {String} namespaces
363
- * @api public
364
- */
365
- function enable(namespaces) {
366
- createDebug.save(namespaces);
367
- createDebug.namespaces = namespaces;
368
-
369
- createDebug.names = [];
370
- createDebug.skips = [];
371
-
372
- let i;
373
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
374
- const len = split.length;
375
-
376
- for (i = 0; i < len; i++) {
377
- if (!split[i]) {
378
- // ignore empty strings
379
- continue;
380
- }
381
-
382
- namespaces = split[i].replace(/\*/g, '.*?');
383
-
384
- if (namespaces[0] === '-') {
385
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
386
- } else {
387
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
388
- }
389
- }
390
- }
391
-
392
- /**
393
- * Disable debug output.
394
- *
395
- * @return {String} namespaces
396
- * @api public
397
- */
398
- function disable() {
399
- const namespaces = [
400
- ...createDebug.names.map(toNamespace),
401
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
402
- ].join(',');
403
- createDebug.enable('');
404
- return namespaces;
405
- }
406
-
407
- /**
408
- * Returns true if the given mode name is enabled, false otherwise.
409
- *
410
- * @param {String} name
411
- * @return {Boolean}
412
- * @api public
413
- */
414
- function enabled(name) {
415
- if (name[name.length - 1] === '*') {
416
- return true;
417
- }
418
-
419
- let i;
420
- let len;
421
-
422
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
423
- if (createDebug.skips[i].test(name)) {
424
- return false;
425
- }
426
- }
427
-
428
- for (i = 0, len = createDebug.names.length; i < len; i++) {
429
- if (createDebug.names[i].test(name)) {
430
- return true;
431
- }
432
- }
433
-
434
- return false;
435
- }
436
-
437
- /**
438
- * Convert regexp to namespace
439
- *
440
- * @param {RegExp} regxep
441
- * @return {String} namespace
442
- * @api private
443
- */
444
- function toNamespace(regexp) {
445
- return regexp.toString()
446
- .substring(2, regexp.toString().length - 2)
447
- .replace(/\.\*\?$/, '*');
448
- }
449
-
450
- /**
451
- * Coerce `val`.
452
- *
453
- * @param {Mixed} val
454
- * @return {Mixed}
455
- * @api private
456
- */
457
- function coerce(val) {
458
- if (val instanceof Error) {
459
- return val.stack || val.message;
460
- }
461
- return val;
462
- }
463
-
464
- /**
465
- * XXX DO NOT USE. This is a temporary stub function.
466
- * XXX It WILL be removed in the next major release.
467
- */
468
- function destroy() {
469
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
470
- }
471
-
472
- createDebug.enable(createDebug.load());
473
-
474
- return createDebug;
475
- }
476
-
477
- var common = setup;
478
-
479
- /* eslint-env browser */
480
-
481
- (function (module, exports) {
482
- /**
483
- * This is the web browser implementation of `debug()`.
484
- */
485
-
486
- exports.formatArgs = formatArgs;
487
- exports.save = save;
488
- exports.load = load;
489
- exports.useColors = useColors;
490
- exports.storage = localstorage();
491
- exports.destroy = (() => {
492
- let warned = false;
493
-
494
- return () => {
495
- if (!warned) {
496
- warned = true;
497
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
498
- }
499
- };
500
- })();
501
-
502
- /**
503
- * Colors.
504
- */
505
-
506
- exports.colors = [
507
- '#0000CC',
508
- '#0000FF',
509
- '#0033CC',
510
- '#0033FF',
511
- '#0066CC',
512
- '#0066FF',
513
- '#0099CC',
514
- '#0099FF',
515
- '#00CC00',
516
- '#00CC33',
517
- '#00CC66',
518
- '#00CC99',
519
- '#00CCCC',
520
- '#00CCFF',
521
- '#3300CC',
522
- '#3300FF',
523
- '#3333CC',
524
- '#3333FF',
525
- '#3366CC',
526
- '#3366FF',
527
- '#3399CC',
528
- '#3399FF',
529
- '#33CC00',
530
- '#33CC33',
531
- '#33CC66',
532
- '#33CC99',
533
- '#33CCCC',
534
- '#33CCFF',
535
- '#6600CC',
536
- '#6600FF',
537
- '#6633CC',
538
- '#6633FF',
539
- '#66CC00',
540
- '#66CC33',
541
- '#9900CC',
542
- '#9900FF',
543
- '#9933CC',
544
- '#9933FF',
545
- '#99CC00',
546
- '#99CC33',
547
- '#CC0000',
548
- '#CC0033',
549
- '#CC0066',
550
- '#CC0099',
551
- '#CC00CC',
552
- '#CC00FF',
553
- '#CC3300',
554
- '#CC3333',
555
- '#CC3366',
556
- '#CC3399',
557
- '#CC33CC',
558
- '#CC33FF',
559
- '#CC6600',
560
- '#CC6633',
561
- '#CC9900',
562
- '#CC9933',
563
- '#CCCC00',
564
- '#CCCC33',
565
- '#FF0000',
566
- '#FF0033',
567
- '#FF0066',
568
- '#FF0099',
569
- '#FF00CC',
570
- '#FF00FF',
571
- '#FF3300',
572
- '#FF3333',
573
- '#FF3366',
574
- '#FF3399',
575
- '#FF33CC',
576
- '#FF33FF',
577
- '#FF6600',
578
- '#FF6633',
579
- '#FF9900',
580
- '#FF9933',
581
- '#FFCC00',
582
- '#FFCC33'
583
- ];
584
-
585
- /**
586
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
587
- * and the Firebug extension (any Firefox version) are known
588
- * to support "%c" CSS customizations.
589
- *
590
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
591
- */
592
-
593
- // eslint-disable-next-line complexity
594
- function useColors() {
595
- // NB: In an Electron preload script, document will be defined but not fully
596
- // initialized. Since we know we're in Chrome, we'll just detect this case
597
- // explicitly
598
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
599
- return true;
600
- }
601
-
602
- // Internet Explorer and Edge do not support colors.
603
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
604
- return false;
605
- }
606
-
607
- // Is webkit? http://stackoverflow.com/a/16459606/376773
608
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
609
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
610
- // Is firebug? http://stackoverflow.com/a/398120/376773
611
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
612
- // Is firefox >= v31?
613
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
614
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
615
- // Double check webkit in userAgent just in case we are in a worker
616
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
617
- }
618
-
619
- /**
620
- * Colorize log arguments if enabled.
621
- *
622
- * @api public
623
- */
624
-
625
- function formatArgs(args) {
626
- args[0] = (this.useColors ? '%c' : '') +
627
- this.namespace +
628
- (this.useColors ? ' %c' : ' ') +
629
- args[0] +
630
- (this.useColors ? '%c ' : ' ') +
631
- '+' + module.exports.humanize(this.diff);
632
-
633
- if (!this.useColors) {
634
- return;
635
- }
636
-
637
- const c = 'color: ' + this.color;
638
- args.splice(1, 0, c, 'color: inherit');
639
-
640
- // The final "%c" is somewhat tricky, because there could be other
641
- // arguments passed either before or after the %c, so we need to
642
- // figure out the correct index to insert the CSS into
643
- let index = 0;
644
- let lastC = 0;
645
- args[0].replace(/%[a-zA-Z%]/g, match => {
646
- if (match === '%%') {
647
- return;
648
- }
649
- index++;
650
- if (match === '%c') {
651
- // We only are interested in the *last* %c
652
- // (the user may have provided their own)
653
- lastC = index;
654
- }
655
- });
656
-
657
- args.splice(lastC, 0, c);
658
- }
659
-
660
- /**
661
- * Invokes `console.debug()` when available.
662
- * No-op when `console.debug` is not a "function".
663
- * If `console.debug` is not available, falls back
664
- * to `console.log`.
665
- *
666
- * @api public
667
- */
668
- exports.log = console.debug || console.log || (() => {});
669
-
670
- /**
671
- * Save `namespaces`.
672
- *
673
- * @param {String} namespaces
674
- * @api private
675
- */
676
- function save(namespaces) {
677
- try {
678
- if (namespaces) {
679
- exports.storage.setItem('debug', namespaces);
680
- } else {
681
- exports.storage.removeItem('debug');
682
- }
683
- } catch (error) {
684
- // Swallow
685
- // XXX (@Qix-) should we be logging these?
686
- }
687
- }
688
-
689
- /**
690
- * Load `namespaces`.
691
- *
692
- * @return {String} returns the previously persisted debug modes
693
- * @api private
694
- */
695
- function load() {
696
- let r;
697
- try {
698
- r = exports.storage.getItem('debug');
699
- } catch (error) {
700
- // Swallow
701
- // XXX (@Qix-) should we be logging these?
702
- }
703
-
704
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
705
- if (!r && typeof process !== 'undefined' && 'env' in process) {
706
- r = process.env.DEBUG;
707
- }
708
-
709
- return r;
710
- }
711
-
712
- /**
713
- * Localstorage attempts to return the localstorage.
714
- *
715
- * This is necessary because safari throws
716
- * when a user disables cookies/localstorage
717
- * and you attempt to access it.
718
- *
719
- * @return {LocalStorage}
720
- * @api private
721
- */
722
-
723
- function localstorage() {
724
- try {
725
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
726
- // The Browser also has localStorage in the global context.
727
- return localStorage;
728
- } catch (error) {
729
- // Swallow
730
- // XXX (@Qix-) should we be logging these?
731
- }
732
- }
733
-
734
- module.exports = common(exports);
735
-
736
- const {formatters} = module.exports;
737
-
738
- /**
739
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
740
- */
741
-
742
- formatters.j = function (v) {
743
- try {
744
- return JSON.stringify(v);
745
- } catch (error) {
746
- return '[UnexpectedJSONParseError]: ' + error.message;
747
- }
748
- };
749
- } (browser, browser.exports));
750
-
751
- var browserExports = browser.exports;
752
- var debug = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
753
-
754
- export { getDefaultExportFromCjs as a, commonjsGlobal as c, debug as d, getAugmentedNamespace as g };