@dxos/hypercore 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8

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.
@@ -10385,7 +10385,7 @@ var createCodecEncoding = (codec, opts) => ({
10385
10385
  var createCrypto = (signer, publicKey) => {
10386
10386
  invariant(signer, void 0, {
10387
10387
  F: __dxlog_file,
10388
- L: 27,
10388
+ L: 28,
10389
10389
  S: void 0,
10390
10390
  A: [
10391
10391
  "signer",
@@ -10394,7 +10394,7 @@ var createCrypto = (signer, publicKey) => {
10394
10394
  });
10395
10395
  invariant(publicKey, void 0, {
10396
10396
  F: __dxlog_file,
10397
- L: 28,
10397
+ L: 29,
10398
10398
  S: void 0,
10399
10399
  A: [
10400
10400
  "publicKey",
@@ -10447,30 +10447,28 @@ var defaultReplicateOptions = {
10447
10447
  // src/hypercore-factory.ts
10448
10448
  var import_hypercore = __toESM(require_hypercore(), 1);
10449
10449
  import { invariant as invariant2 } from "@dxos/invariant";
10450
- import { createStorage, StorageType } from "@dxos/random-access-storage";
10450
+ import { StorageType, createStorage } from "@dxos/random-access-storage";
10451
10451
 
10452
10452
  // src/util.ts
10453
10453
  import util from "@dxos/node-std/util";
10454
10454
  var py = (obj, fn) => util.promisify(fn.bind(obj));
10455
10455
 
10456
10456
  // src/hypercore-factory.ts
10457
- var __dxlog_file2 = "/__w/dxos/dxos/packages/common/hypercore/src/hypercore-factory.ts";
10458
- var HypercoreFactory = class {
10459
- constructor(_root = createStorage({
10460
- type: StorageType.RAM
10461
- }).createDirectory(), _options) {
10462
- this._root = _root;
10463
- this._options = _options;
10464
- invariant2(this._root, void 0, {
10465
- F: __dxlog_file2,
10466
- L: 21,
10467
- S: this,
10468
- A: [
10469
- "this._root",
10470
- ""
10471
- ]
10457
+ function _define_property(obj, key, value) {
10458
+ if (key in obj) {
10459
+ Object.defineProperty(obj, key, {
10460
+ value,
10461
+ enumerable: true,
10462
+ configurable: true,
10463
+ writable: true
10472
10464
  });
10465
+ } else {
10466
+ obj[key] = value;
10473
10467
  }
10468
+ return obj;
10469
+ }
10470
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/common/hypercore/src/hypercore-factory.ts";
10471
+ var HypercoreFactory = class {
10474
10472
  /**
10475
10473
  * Creates a feed using a storage factory prefixed with the feed's key.
10476
10474
  * NOTE: We have to use our `random-access-storage` implementation since the native ones
@@ -10489,6 +10487,23 @@ var HypercoreFactory = class {
10489
10487
  await py(feed, feed.open)();
10490
10488
  return feed;
10491
10489
  }
10490
+ constructor(_root = createStorage({
10491
+ type: StorageType.RAM
10492
+ }).createDirectory(), _options) {
10493
+ _define_property(this, "_root", void 0);
10494
+ _define_property(this, "_options", void 0);
10495
+ this._root = _root;
10496
+ this._options = _options;
10497
+ invariant2(this._root, void 0, {
10498
+ F: __dxlog_file2,
10499
+ L: 21,
10500
+ S: this,
10501
+ A: [
10502
+ "this._root",
10503
+ ""
10504
+ ]
10505
+ });
10506
+ }
10492
10507
  };
10493
10508
 
10494
10509
  // src/iterator.ts