@dxos/hypercore 0.1.56-main.e47dfd1 → 0.1.56-main.e79d64a

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.
@@ -19,7 +19,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
19
19
  }) : x)(function(x) {
20
20
  if (typeof require !== "undefined")
21
21
  return require.apply(this, arguments);
22
- throw new Error('Dynamic require of "' + x + '" is not supported');
22
+ throw Error('Dynamic require of "' + x + '" is not supported');
23
23
  });
24
24
  var __commonJS = (cb, mod) => function __require2() {
25
25
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
@@ -7509,7 +7509,7 @@ var require_common = __commonJS({
7509
7509
  return;
7510
7510
  }
7511
7511
  const self = debug;
7512
- const curr = Number(new Date());
7512
+ const curr = Number(/* @__PURE__ */ new Date());
7513
7513
  const ms = curr - (prevTime || curr);
7514
7514
  self.diff = ms;
7515
7515
  self.prev = prevTime;
@@ -7737,7 +7737,11 @@ var require_browser5 = __commonJS({
7737
7737
  if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
7738
7738
  return false;
7739
7739
  }
7740
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
7740
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
7741
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
7742
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
7743
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
7744
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
7741
7745
  }
7742
7746
  function formatArgs(args) {
7743
7747
  args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
@@ -11282,16 +11286,33 @@ var import_hypercore2 = __toESM(require_hypercore());
11282
11286
 
11283
11287
  // packages/common/hypercore/src/crypto.ts
11284
11288
  import { callbackify } from "@dxos/node-std/util";
11285
- import invariant from "tiny-invariant";
11286
11289
  import { verifySignature } from "@dxos/crypto";
11290
+ import { invariant } from "@dxos/invariant";
11287
11291
  import { arrayToBuffer } from "@dxos/util";
11292
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/common/hypercore/src/crypto.ts";
11288
11293
  var createCodecEncoding = (codec, opts) => ({
11289
11294
  encode: (obj) => arrayToBuffer(codec.encode(obj, opts)),
11290
11295
  decode: (buffer) => codec.decode(buffer, opts)
11291
11296
  });
11292
11297
  var createCrypto = (signer, publicKey) => {
11293
- invariant(signer);
11294
- invariant(publicKey);
11298
+ invariant(signer, void 0, {
11299
+ F: __dxlog_file,
11300
+ L: 27,
11301
+ S: void 0,
11302
+ A: [
11303
+ "signer",
11304
+ ""
11305
+ ]
11306
+ });
11307
+ invariant(publicKey, void 0, {
11308
+ F: __dxlog_file,
11309
+ L: 28,
11310
+ S: void 0,
11311
+ A: [
11312
+ "publicKey",
11313
+ ""
11314
+ ]
11315
+ });
11295
11316
  return {
11296
11317
  sign: (message, secretKey, cb) => {
11297
11318
  callbackify(signer.sign.bind(signer))(publicKey, message, (err, result) => {
@@ -11337,7 +11358,7 @@ var defaultReplicateOptions = {
11337
11358
 
11338
11359
  // packages/common/hypercore/src/hypercore-factory.ts
11339
11360
  var import_hypercore = __toESM(require_hypercore());
11340
- import invariant2 from "tiny-invariant";
11361
+ import { invariant as invariant2 } from "@dxos/invariant";
11341
11362
  import { createStorage, StorageType } from "@dxos/random-access-storage";
11342
11363
 
11343
11364
  // packages/common/hypercore/src/util.ts
@@ -11345,6 +11366,7 @@ import util from "@dxos/node-std/util";
11345
11366
  var py = (obj, fn) => util.promisify(fn.bind(obj));
11346
11367
 
11347
11368
  // packages/common/hypercore/src/hypercore-factory.ts
11369
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/common/hypercore/src/hypercore-factory.ts";
11348
11370
  var HypercoreFactory = class {
11349
11371
  // prettier-ignore
11350
11372
  constructor(_root = createStorage({
@@ -11352,7 +11374,15 @@ var HypercoreFactory = class {
11352
11374
  }).createDirectory(), _options) {
11353
11375
  this._root = _root;
11354
11376
  this._options = _options;
11355
- invariant2(this._root);
11377
+ invariant2(this._root, void 0, {
11378
+ F: __dxlog_file2,
11379
+ L: 22,
11380
+ S: this,
11381
+ A: [
11382
+ "this._root",
11383
+ ""
11384
+ ]
11385
+ });
11356
11386
  }
11357
11387
  /**
11358
11388
  * Creates a feed using a storage factory prefixed with the feed's key.