@xyo-network/previous-hash-store-storage 2.110.9 → 2.110.11

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.
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
8
  var __export = (target, all) => {
10
9
  for (var name in all)
11
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -38,9 +37,6 @@ module.exports = __toCommonJS(src_exports);
38
37
  // src/StoragePreviousHashStore.ts
39
38
  var import_store2 = __toESM(require("store2"), 1);
40
39
  var StoragePreviousHashStore = class _StoragePreviousHashStore {
41
- static {
42
- __name(this, "StoragePreviousHashStore");
43
- }
44
40
  static DefaultNamespace = "xyo-previous-hash-store";
45
41
  static DefaultStorageType = "local";
46
42
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.js'\n","import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACEA,oBAAiC;AAS1B,IAAMA,2BAAN,MAAMA,0BAAAA;EATb,OASaA;;;EACX,OAAgBC,mBAAmB;EACnC,OAAgBC,qBAA8B;EACtCC,aAAaH,0BAAyBC;EACtCG;EACAC,QAAiBL,0BAAyBE;EAElDI,YAAYC,MAAgC;AAC1C,QAAIA,MAAMC,UAAW,MAAKL,aAAaI,KAAKC;AAC5C,QAAID,MAAME,KAAM,MAAKJ,QAAQE,KAAKE;AAElC,SAAKL,WAAYM,cAAAA,QAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EACpE;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKL;EACd;EAEA,IAAIM,OAAgB;AAClB,WAAO,KAAKJ;EACd;EAEA,IAAYM,UAAqB;AAE/B,QAAI,CAAC,MAAMP,SAAU,MAAKA,WAAYM,cAAAA,QAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AACvF,WAAO,KAAKJ;EACd;EAEA,MAAMQ,QAAQC,SAAwC;AACpD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAkBM,cAAmC;AACjE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;","names":["StoragePreviousHashStore","DefaultNamespace","DefaultStorageType","_namespace","_storage","_type","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.js'\n","import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,oBAAiC;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,MAAM,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,MAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,cAAAA,QAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,CAAC,MAAM,SAAU,MAAK,WAAY,cAAAA,QAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
@@ -1,12 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/StoragePreviousHashStore.ts
5
2
  import store from "store2";
6
3
  var StoragePreviousHashStore = class _StoragePreviousHashStore {
7
- static {
8
- __name(this, "StoragePreviousHashStore");
9
- }
10
4
  static DefaultNamespace = "xyo-previous-hash-store";
11
5
  static DefaultStorageType = "local";
12
6
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;AAEA,OAAOA,WAA0B;AAS1B,IAAMC,2BAAN,MAAMA,0BAAAA;EATb,OASaA;;;EACX,OAAgBC,mBAAmB;EACnC,OAAgBC,qBAA8B;EACtCC,aAAaH,0BAAyBC;EACtCG;EACAC,QAAiBL,0BAAyBE;EAElDI,YAAYC,MAAgC;AAC1C,QAAIA,MAAMC,UAAW,MAAKL,aAAaI,KAAKC;AAC5C,QAAID,MAAME,KAAM,MAAKJ,QAAQE,KAAKE;AAElC,SAAKL,WAAYM,MAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EACpE;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKL;EACd;EAEA,IAAIM,OAAgB;AAClB,WAAO,KAAKJ;EACd;EAEA,IAAYM,UAAqB;AAE/B,QAAI,CAAC,MAAMP,SAAU,MAAKA,WAAYM,MAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AACvF,WAAO,KAAKJ;EACd;EAEA,MAAMQ,QAAQC,SAAwC;AACpD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAkBM,cAAmC;AACjE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;","names":["store","StoragePreviousHashStore","DefaultNamespace","DefaultStorageType","_namespace","_storage","_type","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
1
+ {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AAEA,OAAO,WAA0B;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,MAAM,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,MAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,CAAC,MAAM,SAAU,MAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
8
  var __export = (target, all) => {
10
9
  for (var name in all)
11
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -38,9 +37,6 @@ module.exports = __toCommonJS(src_exports);
38
37
  // src/StoragePreviousHashStore.ts
39
38
  var import_store2 = __toESM(require("store2"), 1);
40
39
  var StoragePreviousHashStore = class _StoragePreviousHashStore {
41
- static {
42
- __name(this, "StoragePreviousHashStore");
43
- }
44
40
  static DefaultNamespace = "xyo-previous-hash-store";
45
41
  static DefaultStorageType = "local";
46
42
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.js'\n","import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACEA,oBAAiC;AAS1B,IAAMA,2BAAN,MAAMA,0BAAAA;EATb,OASaA;;;EACX,OAAgBC,mBAAmB;EACnC,OAAgBC,qBAA8B;EACtCC,aAAaH,0BAAyBC;EACtCG;EACAC,QAAiBL,0BAAyBE;EAElDI,YAAYC,MAAgC;AAC1C,QAAIA,MAAMC,UAAW,MAAKL,aAAaI,KAAKC;AAC5C,QAAID,MAAME,KAAM,MAAKJ,QAAQE,KAAKE;AAElC,SAAKL,WAAYM,cAAAA,QAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EACpE;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKL;EACd;EAEA,IAAIM,OAAgB;AAClB,WAAO,KAAKJ;EACd;EAEA,IAAYM,UAAqB;AAE/B,QAAI,CAAC,MAAMP,SAAU,MAAKA,WAAYM,cAAAA,QAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AACvF,WAAO,KAAKJ;EACd;EAEA,MAAMQ,QAAQC,SAAwC;AACpD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAkBM,cAAmC;AACjE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;","names":["StoragePreviousHashStore","DefaultNamespace","DefaultStorageType","_namespace","_storage","_type","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.js'\n","import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,oBAAiC;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,MAAM,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,MAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,cAAAA,QAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,CAAC,MAAM,SAAU,MAAK,WAAY,cAAAA,QAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
@@ -1,12 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/StoragePreviousHashStore.ts
5
2
  import store from "store2";
6
3
  var StoragePreviousHashStore = class _StoragePreviousHashStore {
7
- static {
8
- __name(this, "StoragePreviousHashStore");
9
- }
10
4
  static DefaultNamespace = "xyo-previous-hash-store";
11
5
  static DefaultStorageType = "local";
12
6
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;AAEA,OAAOA,WAA0B;AAS1B,IAAMC,2BAAN,MAAMA,0BAAAA;EATb,OASaA;;;EACX,OAAgBC,mBAAmB;EACnC,OAAgBC,qBAA8B;EACtCC,aAAaH,0BAAyBC;EACtCG;EACAC,QAAiBL,0BAAyBE;EAElDI,YAAYC,MAAgC;AAC1C,QAAIA,MAAMC,UAAW,MAAKL,aAAaI,KAAKC;AAC5C,QAAID,MAAME,KAAM,MAAKJ,QAAQE,KAAKE;AAElC,SAAKL,WAAYM,MAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EACpE;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKL;EACd;EAEA,IAAIM,OAAgB;AAClB,WAAO,KAAKJ;EACd;EAEA,IAAYM,UAAqB;AAE/B,QAAI,CAAC,MAAMP,SAAU,MAAKA,WAAYM,MAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AACvF,WAAO,KAAKJ;EACd;EAEA,MAAMQ,QAAQC,SAAwC;AACpD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAkBM,cAAmC;AACjE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;","names":["store","StoragePreviousHashStore","DefaultNamespace","DefaultStorageType","_namespace","_storage","_type","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
1
+ {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AAEA,OAAO,WAA0B;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,MAAM,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,MAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,CAAC,MAAM,SAAU,MAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
@@ -5,8 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
8
  var __export = (target, all) => {
11
9
  for (var name in all)
12
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -28,7 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
26
  mod
29
27
  ));
30
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
29
 
33
30
  // src/index.ts
34
31
  var src_exports = {};
@@ -39,7 +36,9 @@ module.exports = __toCommonJS(src_exports);
39
36
 
40
37
  // src/StoragePreviousHashStore.ts
41
38
  var import_store2 = __toESM(require("store2"), 1);
42
- var _StoragePreviousHashStore = class _StoragePreviousHashStore {
39
+ var StoragePreviousHashStore = class _StoragePreviousHashStore {
40
+ static DefaultNamespace = "xyo-previous-hash-store";
41
+ static DefaultStorageType = "local";
43
42
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
44
43
  _storage;
45
44
  _type = _StoragePreviousHashStore.DefaultStorageType;
@@ -69,10 +68,6 @@ var _StoragePreviousHashStore = class _StoragePreviousHashStore {
69
68
  await this.storage.set(address, previousHash);
70
69
  }
71
70
  };
72
- __name(_StoragePreviousHashStore, "StoragePreviousHashStore");
73
- __publicField(_StoragePreviousHashStore, "DefaultNamespace", "xyo-previous-hash-store");
74
- __publicField(_StoragePreviousHashStore, "DefaultStorageType", "local");
75
- var StoragePreviousHashStore = _StoragePreviousHashStore;
76
71
  // Annotate the CommonJS export names for ESM import in node:
77
72
  0 && (module.exports = {
78
73
  StoragePreviousHashStore
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.js'\n","import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACEA,oBAAiC;AAS1B,IAAMA,4BAAN,MAAMA,0BAAAA;EAGHC,aAAaD,0BAAyBE;EACtCC;EACAC,QAAiBJ,0BAAyBK;EAElDC,YAAYC,MAAgC;AAC1C,QAAIA,6BAAMC,UAAW,MAAKP,aAAaM,KAAKC;AAC5C,QAAID,6BAAME,KAAM,MAAKL,QAAQG,KAAKE;AAElC,SAAKN,WAAYO,cAAAA,QAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EACpE;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKP;EACd;EAEA,IAAIQ,OAAgB;AAClB,WAAO,KAAKL;EACd;EAEA,IAAYO,UAAqB;AAE/B,QAAI,EAAC,6BAAMR,UAAU,MAAKA,WAAYO,cAAAA,QAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AACvF,WAAO,KAAKL;EACd;EAEA,MAAMS,QAAQC,SAAwC;AACpD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAkBM,cAAmC;AACjE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;AAtCanB;AACX,cADWA,2BACKE,oBAAmB;AACnC,cAFWF,2BAEKK,sBAA8B;AAFzC,IAAML,2BAAN;","names":["StoragePreviousHashStore","_namespace","DefaultNamespace","_storage","_type","DefaultStorageType","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.js'\n","import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,oBAAiC;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,6BAAM,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,6BAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,cAAAA,QAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,EAAC,6BAAM,UAAU,MAAK,WAAY,cAAAA,QAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
@@ -1,11 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
-
6
1
  // src/StoragePreviousHashStore.ts
7
2
  import store from "store2";
8
- var _StoragePreviousHashStore = class _StoragePreviousHashStore {
3
+ var StoragePreviousHashStore = class _StoragePreviousHashStore {
4
+ static DefaultNamespace = "xyo-previous-hash-store";
5
+ static DefaultStorageType = "local";
9
6
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
10
7
  _storage;
11
8
  _type = _StoragePreviousHashStore.DefaultStorageType;
@@ -35,10 +32,6 @@ var _StoragePreviousHashStore = class _StoragePreviousHashStore {
35
32
  await this.storage.set(address, previousHash);
36
33
  }
37
34
  };
38
- __name(_StoragePreviousHashStore, "StoragePreviousHashStore");
39
- __publicField(_StoragePreviousHashStore, "DefaultNamespace", "xyo-previous-hash-store");
40
- __publicField(_StoragePreviousHashStore, "DefaultStorageType", "local");
41
- var StoragePreviousHashStore = _StoragePreviousHashStore;
42
35
  export {
43
36
  StoragePreviousHashStore
44
37
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;AAEA,OAAOA,WAA0B;AAS1B,IAAMC,4BAAN,MAAMA,0BAAAA;EAGHC,aAAaD,0BAAyBE;EACtCC;EACAC,QAAiBJ,0BAAyBK;EAElDC,YAAYC,MAAgC;AAC1C,QAAIA,6BAAMC,UAAW,MAAKP,aAAaM,KAAKC;AAC5C,QAAID,6BAAME,KAAM,MAAKL,QAAQG,KAAKE;AAElC,SAAKN,WAAYO,MAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EACpE;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKP;EACd;EAEA,IAAIQ,OAAgB;AAClB,WAAO,KAAKL;EACd;EAEA,IAAYO,UAAqB;AAE/B,QAAI,EAAC,6BAAMR,UAAU,MAAKA,WAAYO,MAAc,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AACvF,WAAO,KAAKL;EACd;EAEA,MAAMS,QAAQC,SAAwC;AACpD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAkBM,cAAmC;AACjE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;AAtCanB;AACX,cADWA,2BACKE,oBAAmB;AACnC,cAFWF,2BAEKK,sBAA8B;AAFzC,IAAML,2BAAN;","names":["store","StoragePreviousHashStore","_namespace","DefaultNamespace","_storage","_type","DefaultStorageType","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
1
+ {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AAEA,OAAO,WAA0B;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,6BAAM,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,6BAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,EAAC,6BAAM,UAAU,MAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
package/package.json CHANGED
@@ -11,13 +11,15 @@
11
11
  },
12
12
  "description": "Primary SDK for using XYO Protocol 2.0",
13
13
  "dependencies": {
14
- "@xylabs/hex": "^3.6.4",
15
- "@xyo-network/previous-hash-store-model": "^2.110.9",
14
+ "@xylabs/hex": "^3.6.5",
15
+ "@xyo-network/previous-hash-store-model": "^2.110.11",
16
16
  "store2": "^2.14.3"
17
17
  },
18
18
  "devDependencies": {
19
- "@xylabs/ts-scripts-yarn3": "^3.12.4",
20
- "@xylabs/tsconfig": "^3.12.4",
19
+ "@types/node": "^20.14.12",
20
+ "@types/uuid": "^10.0.0",
21
+ "@xylabs/ts-scripts-yarn3": "^3.13.3",
22
+ "@xylabs/tsconfig": "^3.13.3",
21
23
  "typescript": "^5.5.4",
22
24
  "uuid": "^10.0.0"
23
25
  },
@@ -59,6 +61,6 @@
59
61
  },
60
62
  "sideEffects": false,
61
63
  "types": "dist/node/index.d.ts",
62
- "version": "2.110.9",
64
+ "version": "2.110.11",
63
65
  "type": "module"
64
66
  }
package/xy.config.ts CHANGED
@@ -10,5 +10,4 @@ const config: XyTsupConfig = {
10
10
  },
11
11
  }
12
12
 
13
- // eslint-disable-next-line import/no-default-export
14
13
  export default config