@waku/core 0.0.8 → 0.0.9

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.
@@ -746,7 +746,7 @@ var common$1 = setup;
746
746
 
747
747
  var debug = browser.exports;
748
748
 
749
- var aspromise = asPromise$1;
749
+ var aspromise = asPromise;
750
750
 
751
751
  /**
752
752
  * Callback as used by {@link util.asPromise}.
@@ -765,7 +765,7 @@ var aspromise = asPromise$1;
765
765
  * @param {...*} params Function arguments
766
766
  * @returns {Promise<*>} Promisified function
767
767
  */
768
- function asPromise$1(fn, ctx/*, varargs */) {
768
+ function asPromise(fn, ctx/*, varargs */) {
769
769
  var params = new Array(arguments.length - 1),
770
770
  offset = 0,
771
771
  index = 2,
@@ -1351,7 +1351,7 @@ function readUintBE(buf, pos) {
1351
1351
  | buf[pos + 3]) >>> 0;
1352
1352
  }
1353
1353
 
1354
- var inquire_1 = inquire$1;
1354
+ var inquire_1 = inquire;
1355
1355
 
1356
1356
  /**
1357
1357
  * Requires a module only if available.
@@ -1359,7 +1359,7 @@ var inquire_1 = inquire$1;
1359
1359
  * @param {string} moduleName Module to require
1360
1360
  * @returns {?Object} Required module if available and not empty, otherwise `null`
1361
1361
  */
1362
- function inquire$1(moduleName) {
1362
+ function inquire(moduleName) {
1363
1363
  try {
1364
1364
  var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
1365
1365
  if (mod && (mod.length || Object.keys(mod).length))
@@ -3426,288 +3426,311 @@ var roots = {};
3426
3426
 
3427
3427
  var util$2 = {exports: {}};
3428
3428
 
3429
- var codegen_1 = codegen;
3429
+ var codegen_1;
3430
+ var hasRequiredCodegen;
3431
+
3432
+ function requireCodegen () {
3433
+ if (hasRequiredCodegen) return codegen_1;
3434
+ hasRequiredCodegen = 1;
3435
+ codegen_1 = codegen;
3430
3436
 
3431
- /**
3432
- * Begins generating a function.
3433
- * @memberof util
3434
- * @param {string[]} functionParams Function parameter names
3435
- * @param {string} [functionName] Function name if not anonymous
3436
- * @returns {Codegen} Appender that appends code to the function's body
3437
- */
3438
- function codegen(functionParams, functionName) {
3437
+ /**
3438
+ * Begins generating a function.
3439
+ * @memberof util
3440
+ * @param {string[]} functionParams Function parameter names
3441
+ * @param {string} [functionName] Function name if not anonymous
3442
+ * @returns {Codegen} Appender that appends code to the function's body
3443
+ */
3444
+ function codegen(functionParams, functionName) {
3439
3445
 
3440
- /* istanbul ignore if */
3441
- if (typeof functionParams === "string") {
3442
- functionName = functionParams;
3443
- functionParams = undefined;
3444
- }
3446
+ /* istanbul ignore if */
3447
+ if (typeof functionParams === "string") {
3448
+ functionName = functionParams;
3449
+ functionParams = undefined;
3450
+ }
3445
3451
 
3446
- var body = [];
3452
+ var body = [];
3447
3453
 
3448
- /**
3449
- * Appends code to the function's body or finishes generation.
3450
- * @typedef Codegen
3451
- * @type {function}
3452
- * @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any
3453
- * @param {...*} [formatParams] Format parameters
3454
- * @returns {Codegen|Function} Itself or the generated function if finished
3455
- * @throws {Error} If format parameter counts do not match
3456
- */
3454
+ /**
3455
+ * Appends code to the function's body or finishes generation.
3456
+ * @typedef Codegen
3457
+ * @type {function}
3458
+ * @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any
3459
+ * @param {...*} [formatParams] Format parameters
3460
+ * @returns {Codegen|Function} Itself or the generated function if finished
3461
+ * @throws {Error} If format parameter counts do not match
3462
+ */
3457
3463
 
3458
- function Codegen(formatStringOrScope) {
3459
- // note that explicit array handling below makes this ~50% faster
3464
+ function Codegen(formatStringOrScope) {
3465
+ // note that explicit array handling below makes this ~50% faster
3460
3466
 
3461
- // finish the function
3462
- if (typeof formatStringOrScope !== "string") {
3463
- var source = toString();
3464
- if (codegen.verbose)
3465
- console.log("codegen: " + source); // eslint-disable-line no-console
3466
- source = "return " + source;
3467
- if (formatStringOrScope) {
3468
- var scopeKeys = Object.keys(formatStringOrScope),
3469
- scopeParams = new Array(scopeKeys.length + 1),
3470
- scopeValues = new Array(scopeKeys.length),
3471
- scopeOffset = 0;
3472
- while (scopeOffset < scopeKeys.length) {
3473
- scopeParams[scopeOffset] = scopeKeys[scopeOffset];
3474
- scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];
3475
- }
3476
- scopeParams[scopeOffset] = source;
3477
- return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func
3478
- }
3479
- return Function(source)(); // eslint-disable-line no-new-func
3480
- }
3467
+ // finish the function
3468
+ if (typeof formatStringOrScope !== "string") {
3469
+ var source = toString();
3470
+ if (codegen.verbose)
3471
+ console.log("codegen: " + source); // eslint-disable-line no-console
3472
+ source = "return " + source;
3473
+ if (formatStringOrScope) {
3474
+ var scopeKeys = Object.keys(formatStringOrScope),
3475
+ scopeParams = new Array(scopeKeys.length + 1),
3476
+ scopeValues = new Array(scopeKeys.length),
3477
+ scopeOffset = 0;
3478
+ while (scopeOffset < scopeKeys.length) {
3479
+ scopeParams[scopeOffset] = scopeKeys[scopeOffset];
3480
+ scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];
3481
+ }
3482
+ scopeParams[scopeOffset] = source;
3483
+ return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func
3484
+ }
3485
+ return Function(source)(); // eslint-disable-line no-new-func
3486
+ }
3481
3487
 
3482
- // otherwise append to body
3483
- var formatParams = new Array(arguments.length - 1),
3484
- formatOffset = 0;
3485
- while (formatOffset < formatParams.length)
3486
- formatParams[formatOffset] = arguments[++formatOffset];
3487
- formatOffset = 0;
3488
- formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {
3489
- var value = formatParams[formatOffset++];
3490
- switch ($1) {
3491
- case "d": case "f": return String(Number(value));
3492
- case "i": return String(Math.floor(value));
3493
- case "j": return JSON.stringify(value);
3494
- case "s": return String(value);
3495
- }
3496
- return "%";
3497
- });
3498
- if (formatOffset !== formatParams.length)
3499
- throw Error("parameter count mismatch");
3500
- body.push(formatStringOrScope);
3501
- return Codegen;
3502
- }
3488
+ // otherwise append to body
3489
+ var formatParams = new Array(arguments.length - 1),
3490
+ formatOffset = 0;
3491
+ while (formatOffset < formatParams.length)
3492
+ formatParams[formatOffset] = arguments[++formatOffset];
3493
+ formatOffset = 0;
3494
+ formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {
3495
+ var value = formatParams[formatOffset++];
3496
+ switch ($1) {
3497
+ case "d": case "f": return String(Number(value));
3498
+ case "i": return String(Math.floor(value));
3499
+ case "j": return JSON.stringify(value);
3500
+ case "s": return String(value);
3501
+ }
3502
+ return "%";
3503
+ });
3504
+ if (formatOffset !== formatParams.length)
3505
+ throw Error("parameter count mismatch");
3506
+ body.push(formatStringOrScope);
3507
+ return Codegen;
3508
+ }
3503
3509
 
3504
- function toString(functionNameOverride) {
3505
- return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
3506
- }
3510
+ function toString(functionNameOverride) {
3511
+ return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
3512
+ }
3507
3513
 
3508
- Codegen.toString = toString;
3509
- return Codegen;
3510
- }
3514
+ Codegen.toString = toString;
3515
+ return Codegen;
3516
+ }
3511
3517
 
3512
- /**
3513
- * Begins generating a function.
3514
- * @memberof util
3515
- * @function codegen
3516
- * @param {string} [functionName] Function name if not anonymous
3517
- * @returns {Codegen} Appender that appends code to the function's body
3518
- * @variation 2
3519
- */
3518
+ /**
3519
+ * Begins generating a function.
3520
+ * @memberof util
3521
+ * @function codegen
3522
+ * @param {string} [functionName] Function name if not anonymous
3523
+ * @returns {Codegen} Appender that appends code to the function's body
3524
+ * @variation 2
3525
+ */
3520
3526
 
3521
- /**
3522
- * When set to `true`, codegen will log generated code to console. Useful for debugging.
3523
- * @name util.codegen.verbose
3524
- * @type {boolean}
3525
- */
3526
- codegen.verbose = false;
3527
+ /**
3528
+ * When set to `true`, codegen will log generated code to console. Useful for debugging.
3529
+ * @name util.codegen.verbose
3530
+ * @type {boolean}
3531
+ */
3532
+ codegen.verbose = false;
3533
+ return codegen_1;
3534
+ }
3527
3535
 
3528
- var fetch_1 = fetch;
3536
+ var fetch_1;
3537
+ var hasRequiredFetch;
3538
+
3539
+ function requireFetch () {
3540
+ if (hasRequiredFetch) return fetch_1;
3541
+ hasRequiredFetch = 1;
3542
+ fetch_1 = fetch;
3529
3543
 
3530
- var asPromise = aspromise,
3531
- inquire = inquire_1;
3544
+ var asPromise = aspromise,
3545
+ inquire = inquire_1;
3532
3546
 
3533
- var fs = inquire("fs");
3547
+ var fs = inquire("fs");
3534
3548
 
3535
- /**
3536
- * Node-style callback as used by {@link util.fetch}.
3537
- * @typedef FetchCallback
3538
- * @type {function}
3539
- * @param {?Error} error Error, if any, otherwise `null`
3540
- * @param {string} [contents] File contents, if there hasn't been an error
3541
- * @returns {undefined}
3542
- */
3549
+ /**
3550
+ * Node-style callback as used by {@link util.fetch}.
3551
+ * @typedef FetchCallback
3552
+ * @type {function}
3553
+ * @param {?Error} error Error, if any, otherwise `null`
3554
+ * @param {string} [contents] File contents, if there hasn't been an error
3555
+ * @returns {undefined}
3556
+ */
3543
3557
 
3544
- /**
3545
- * Options as used by {@link util.fetch}.
3546
- * @typedef FetchOptions
3547
- * @type {Object}
3548
- * @property {boolean} [binary=false] Whether expecting a binary response
3549
- * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
3550
- */
3558
+ /**
3559
+ * Options as used by {@link util.fetch}.
3560
+ * @typedef FetchOptions
3561
+ * @type {Object}
3562
+ * @property {boolean} [binary=false] Whether expecting a binary response
3563
+ * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
3564
+ */
3551
3565
 
3552
- /**
3553
- * Fetches the contents of a file.
3554
- * @memberof util
3555
- * @param {string} filename File path or url
3556
- * @param {FetchOptions} options Fetch options
3557
- * @param {FetchCallback} callback Callback function
3558
- * @returns {undefined}
3559
- */
3560
- function fetch(filename, options, callback) {
3561
- if (typeof options === "function") {
3562
- callback = options;
3563
- options = {};
3564
- } else if (!options)
3565
- options = {};
3566
+ /**
3567
+ * Fetches the contents of a file.
3568
+ * @memberof util
3569
+ * @param {string} filename File path or url
3570
+ * @param {FetchOptions} options Fetch options
3571
+ * @param {FetchCallback} callback Callback function
3572
+ * @returns {undefined}
3573
+ */
3574
+ function fetch(filename, options, callback) {
3575
+ if (typeof options === "function") {
3576
+ callback = options;
3577
+ options = {};
3578
+ } else if (!options)
3579
+ options = {};
3566
3580
 
3567
- if (!callback)
3568
- return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
3581
+ if (!callback)
3582
+ return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
3569
3583
 
3570
- // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.
3571
- if (!options.xhr && fs && fs.readFile)
3572
- return fs.readFile(filename, function fetchReadFileCallback(err, contents) {
3573
- return err && typeof XMLHttpRequest !== "undefined"
3574
- ? fetch.xhr(filename, options, callback)
3575
- : err
3576
- ? callback(err)
3577
- : callback(null, options.binary ? contents : contents.toString("utf8"));
3578
- });
3584
+ // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.
3585
+ if (!options.xhr && fs && fs.readFile)
3586
+ return fs.readFile(filename, function fetchReadFileCallback(err, contents) {
3587
+ return err && typeof XMLHttpRequest !== "undefined"
3588
+ ? fetch.xhr(filename, options, callback)
3589
+ : err
3590
+ ? callback(err)
3591
+ : callback(null, options.binary ? contents : contents.toString("utf8"));
3592
+ });
3579
3593
 
3580
- // use the XHR version otherwise.
3581
- return fetch.xhr(filename, options, callback);
3582
- }
3594
+ // use the XHR version otherwise.
3595
+ return fetch.xhr(filename, options, callback);
3596
+ }
3583
3597
 
3584
- /**
3585
- * Fetches the contents of a file.
3586
- * @name util.fetch
3587
- * @function
3588
- * @param {string} path File path or url
3589
- * @param {FetchCallback} callback Callback function
3590
- * @returns {undefined}
3591
- * @variation 2
3592
- */
3598
+ /**
3599
+ * Fetches the contents of a file.
3600
+ * @name util.fetch
3601
+ * @function
3602
+ * @param {string} path File path or url
3603
+ * @param {FetchCallback} callback Callback function
3604
+ * @returns {undefined}
3605
+ * @variation 2
3606
+ */
3593
3607
 
3594
- /**
3595
- * Fetches the contents of a file.
3596
- * @name util.fetch
3597
- * @function
3598
- * @param {string} path File path or url
3599
- * @param {FetchOptions} [options] Fetch options
3600
- * @returns {Promise<string|Uint8Array>} Promise
3601
- * @variation 3
3602
- */
3608
+ /**
3609
+ * Fetches the contents of a file.
3610
+ * @name util.fetch
3611
+ * @function
3612
+ * @param {string} path File path or url
3613
+ * @param {FetchOptions} [options] Fetch options
3614
+ * @returns {Promise<string|Uint8Array>} Promise
3615
+ * @variation 3
3616
+ */
3603
3617
 
3604
- /**/
3605
- fetch.xhr = function fetch_xhr(filename, options, callback) {
3606
- var xhr = new XMLHttpRequest();
3607
- xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {
3618
+ /**/
3619
+ fetch.xhr = function fetch_xhr(filename, options, callback) {
3620
+ var xhr = new XMLHttpRequest();
3621
+ xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {
3608
3622
 
3609
- if (xhr.readyState !== 4)
3610
- return undefined;
3623
+ if (xhr.readyState !== 4)
3624
+ return undefined;
3611
3625
 
3612
- // local cors security errors return status 0 / empty string, too. afaik this cannot be
3613
- // reliably distinguished from an actually empty file for security reasons. feel free
3614
- // to send a pull request if you are aware of a solution.
3615
- if (xhr.status !== 0 && xhr.status !== 200)
3616
- return callback(Error("status " + xhr.status));
3626
+ // local cors security errors return status 0 / empty string, too. afaik this cannot be
3627
+ // reliably distinguished from an actually empty file for security reasons. feel free
3628
+ // to send a pull request if you are aware of a solution.
3629
+ if (xhr.status !== 0 && xhr.status !== 200)
3630
+ return callback(Error("status " + xhr.status));
3617
3631
 
3618
- // if binary data is expected, make sure that some sort of array is returned, even if
3619
- // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.
3620
- if (options.binary) {
3621
- var buffer = xhr.response;
3622
- if (!buffer) {
3623
- buffer = [];
3624
- for (var i = 0; i < xhr.responseText.length; ++i)
3625
- buffer.push(xhr.responseText.charCodeAt(i) & 255);
3626
- }
3627
- return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);
3628
- }
3629
- return callback(null, xhr.responseText);
3630
- };
3632
+ // if binary data is expected, make sure that some sort of array is returned, even if
3633
+ // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.
3634
+ if (options.binary) {
3635
+ var buffer = xhr.response;
3636
+ if (!buffer) {
3637
+ buffer = [];
3638
+ for (var i = 0; i < xhr.responseText.length; ++i)
3639
+ buffer.push(xhr.responseText.charCodeAt(i) & 255);
3640
+ }
3641
+ return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);
3642
+ }
3643
+ return callback(null, xhr.responseText);
3644
+ };
3631
3645
 
3632
- if (options.binary) {
3633
- // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers
3634
- if ("overrideMimeType" in xhr)
3635
- xhr.overrideMimeType("text/plain; charset=x-user-defined");
3636
- xhr.responseType = "arraybuffer";
3637
- }
3646
+ if (options.binary) {
3647
+ // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers
3648
+ if ("overrideMimeType" in xhr)
3649
+ xhr.overrideMimeType("text/plain; charset=x-user-defined");
3650
+ xhr.responseType = "arraybuffer";
3651
+ }
3638
3652
 
3639
- xhr.open("GET", filename);
3640
- xhr.send();
3641
- };
3653
+ xhr.open("GET", filename);
3654
+ xhr.send();
3655
+ };
3656
+ return fetch_1;
3657
+ }
3642
3658
 
3643
3659
  var path = {};
3644
3660
 
3645
- (function (exports) {
3661
+ var hasRequiredPath;
3662
+
3663
+ function requirePath () {
3664
+ if (hasRequiredPath) return path;
3665
+ hasRequiredPath = 1;
3666
+ (function (exports) {
3646
3667
 
3647
- /**
3648
- * A minimal path module to resolve Unix, Windows and URL paths alike.
3649
- * @memberof util
3650
- * @namespace
3651
- */
3652
- var path = exports;
3668
+ /**
3669
+ * A minimal path module to resolve Unix, Windows and URL paths alike.
3670
+ * @memberof util
3671
+ * @namespace
3672
+ */
3673
+ var path = exports;
3653
3674
 
3654
- var isAbsolute =
3655
- /**
3656
- * Tests if the specified path is absolute.
3657
- * @param {string} path Path to test
3658
- * @returns {boolean} `true` if path is absolute
3659
- */
3660
- path.isAbsolute = function isAbsolute(path) {
3661
- return /^(?:\/|\w+:)/.test(path);
3662
- };
3675
+ var isAbsolute =
3676
+ /**
3677
+ * Tests if the specified path is absolute.
3678
+ * @param {string} path Path to test
3679
+ * @returns {boolean} `true` if path is absolute
3680
+ */
3681
+ path.isAbsolute = function isAbsolute(path) {
3682
+ return /^(?:\/|\w+:)/.test(path);
3683
+ };
3663
3684
 
3664
- var normalize =
3665
- /**
3666
- * Normalizes the specified path.
3667
- * @param {string} path Path to normalize
3668
- * @returns {string} Normalized path
3669
- */
3670
- path.normalize = function normalize(path) {
3671
- path = path.replace(/\\/g, "/")
3672
- .replace(/\/{2,}/g, "/");
3673
- var parts = path.split("/"),
3674
- absolute = isAbsolute(path),
3675
- prefix = "";
3676
- if (absolute)
3677
- prefix = parts.shift() + "/";
3678
- for (var i = 0; i < parts.length;) {
3679
- if (parts[i] === "..") {
3680
- if (i > 0 && parts[i - 1] !== "..")
3681
- parts.splice(--i, 2);
3682
- else if (absolute)
3683
- parts.splice(i, 1);
3684
- else
3685
- ++i;
3686
- } else if (parts[i] === ".")
3687
- parts.splice(i, 1);
3688
- else
3689
- ++i;
3690
- }
3691
- return prefix + parts.join("/");
3692
- };
3685
+ var normalize =
3686
+ /**
3687
+ * Normalizes the specified path.
3688
+ * @param {string} path Path to normalize
3689
+ * @returns {string} Normalized path
3690
+ */
3691
+ path.normalize = function normalize(path) {
3692
+ path = path.replace(/\\/g, "/")
3693
+ .replace(/\/{2,}/g, "/");
3694
+ var parts = path.split("/"),
3695
+ absolute = isAbsolute(path),
3696
+ prefix = "";
3697
+ if (absolute)
3698
+ prefix = parts.shift() + "/";
3699
+ for (var i = 0; i < parts.length;) {
3700
+ if (parts[i] === "..") {
3701
+ if (i > 0 && parts[i - 1] !== "..")
3702
+ parts.splice(--i, 2);
3703
+ else if (absolute)
3704
+ parts.splice(i, 1);
3705
+ else
3706
+ ++i;
3707
+ } else if (parts[i] === ".")
3708
+ parts.splice(i, 1);
3709
+ else
3710
+ ++i;
3711
+ }
3712
+ return prefix + parts.join("/");
3713
+ };
3693
3714
 
3694
- /**
3695
- * Resolves the specified include path against the specified origin path.
3696
- * @param {string} originPath Path to the origin file
3697
- * @param {string} includePath Include path relative to origin path
3698
- * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
3699
- * @returns {string} Path to the include file
3700
- */
3701
- path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
3702
- if (!alreadyNormalized)
3703
- includePath = normalize(includePath);
3704
- if (isAbsolute(includePath))
3705
- return includePath;
3706
- if (!alreadyNormalized)
3707
- originPath = normalize(originPath);
3708
- return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
3709
- };
3715
+ /**
3716
+ * Resolves the specified include path against the specified origin path.
3717
+ * @param {string} originPath Path to the origin file
3718
+ * @param {string} includePath Include path relative to origin path
3719
+ * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
3720
+ * @returns {string} Path to the include file
3721
+ */
3722
+ path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
3723
+ if (!alreadyNormalized)
3724
+ includePath = normalize(includePath);
3725
+ if (isAbsolute(includePath))
3726
+ return includePath;
3727
+ if (!alreadyNormalized)
3728
+ originPath = normalize(originPath);
3729
+ return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
3730
+ };
3710
3731
  } (path));
3732
+ return path;
3733
+ }
3711
3734
 
3712
3735
  var types$1 = {};
3713
3736
 
@@ -7293,9 +7316,9 @@ function requireUtil () {
7293
7316
  var Type, // cyclic
7294
7317
  Enum;
7295
7318
 
7296
- util.codegen = codegen_1;
7297
- util.fetch = fetch_1;
7298
- util.path = path;
7319
+ util.codegen = requireCodegen();
7320
+ util.fetch = requireFetch();
7321
+ util.path = requirePath();
7299
7322
 
7300
7323
  /**
7301
7324
  * Node's fs module if available.
@@ -0,0 +1,39 @@
1
+ import { d as debug, T as TopicOnlyMessage$1 } from './peer_exchange-53df2b11.js';
2
+
3
+ const log = debug("waku:message:topic-only");
4
+ class TopicOnlyMessage {
5
+ constructor(proto) {
6
+ this.proto = proto;
7
+ }
8
+ get contentTopic() {
9
+ return this.proto.contentTopic ?? "";
10
+ }
11
+ }
12
+ class TopicOnlyDecoder {
13
+ constructor() {
14
+ this.contentTopic = "";
15
+ }
16
+ fromWireToProtoObj(bytes) {
17
+ const protoMessage = TopicOnlyMessage$1.decode(bytes);
18
+ log("Message decoded", protoMessage);
19
+ return Promise.resolve({
20
+ contentTopic: protoMessage.contentTopic,
21
+ payload: undefined,
22
+ rateLimitProof: undefined,
23
+ timestamp: undefined,
24
+ version: undefined,
25
+ ephemeral: undefined,
26
+ });
27
+ }
28
+ async fromProtoObj(proto) {
29
+ return new TopicOnlyMessage(proto);
30
+ }
31
+ }
32
+
33
+ var topic_only_message = /*#__PURE__*/Object.freeze({
34
+ __proto__: null,
35
+ TopicOnlyMessage: TopicOnlyMessage,
36
+ TopicOnlyDecoder: TopicOnlyDecoder
37
+ });
38
+
39
+ export { TopicOnlyDecoder as T, TopicOnlyMessage as a, topic_only_message as t };