@xyo-network/previous-hash-store-storage 2.110.18 → 2.111.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAG1E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA4B;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAU;IACrD,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAuD;gBAExD,IAAI,CAAC,EAAE,uBAAuB;IAO1C,IAAI,SAAS,WAEZ;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,KAAK,OAAO,GAIlB;IAEK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
1
+ {"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAA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1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.ts'\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
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.ts'\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\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\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,EAEA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EAEA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
@@ -35,4 +35,4 @@ var StoragePreviousHashStore = class _StoragePreviousHashStore {
35
35
  export {
36
36
  StoragePreviousHashStore
37
37
  };
38
- //# sourceMappingURL=index.js.map
38
+ //# sourceMappingURL=index.mjs.map
@@ -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,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":[]}
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\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\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,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AO,CAAC,IAAI,CAAC;CAGnE"}
1
+ {"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAG1E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA4B;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAU;IACrD,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAuD;gBAExD,IAAI,CAAC,EAAE,uBAAuB;IAO1C,IAAI,SAAS,WAEZ;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,KAAK,OAAO,GAIlB;IAEK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAK/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,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AC,IAAI,CAAC;IAI3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.ts'\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
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.ts'\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\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\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,EAEA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EAEA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
@@ -35,4 +35,4 @@ var StoragePreviousHashStore = class _StoragePreviousHashStore {
35
35
  export {
36
36
  StoragePreviousHashStore
37
37
  };
38
- //# sourceMappingURL=index.js.map
38
+ //# sourceMappingURL=index.mjs.map
@@ -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,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":[]}
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\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\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,W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AU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
1
+ {"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAG1E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA4B;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAU;IACrD,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAuD;gBAExD,IAAI,CAAC,EAAE,uBAAuB;IAO1C,IAAI,SAAS,WAEZ;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,KAAK,OAAO,GAIlB;IAEK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAK/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAG1E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA4B;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAU;IACrD,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAuD;gBAExD,IAAI,CAAC,EAAE,uBAAuB;IAO1C,IAAI,SAAS,WAEZ;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,KAAK,OAAO,GAIlB;IAEK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
1
+ {"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAG1E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB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EK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAK/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.ts'\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
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore.ts'\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\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\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,EAEA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EAEA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
@@ -35,4 +35,4 @@ var StoragePreviousHashStore = class _StoragePreviousHashStore {
35
35
  export {
36
36
  StoragePreviousHashStore
37
37
  };
38
- //# sourceMappingURL=index.js.map
38
+ //# sourceMappingURL=index.mjs.map
@@ -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,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":[]}
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\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\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,EAEA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EAEA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
package/package.json CHANGED
@@ -11,15 +11,15 @@
11
11
  },
12
12
  "description": "Primary SDK for using XYO Protocol 2.0",
13
13
  "dependencies": {
14
- "@xylabs/hex": "^3.6.6",
15
- "@xyo-network/previous-hash-store-model": "^2.110.18",
14
+ "@xylabs/hex": "^3.6.8",
15
+ "@xyo-network/previous-hash-store-model": "^2.111.0",
16
16
  "store2": "^2.14.3"
17
17
  },
18
18
  "devDependencies": {
19
- "@types/node": "^22.0.2",
19
+ "@types/node": "^22.1.0",
20
20
  "@types/uuid": "^10.0.0",
21
- "@xylabs/ts-scripts-yarn3": "^3.14.1",
22
- "@xylabs/tsconfig": "^3.14.1",
21
+ "@xylabs/ts-scripts-yarn3": "^3.15.5",
22
+ "@xylabs/tsconfig": "^3.15.5",
23
23
  "typescript": "^5.5.4",
24
24
  "uuid": "^10.0.0"
25
25
  },
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "import": {
34
34
  "types": "./dist/browser/index.d.mts",
35
- "default": "./dist/browser/index.js"
35
+ "default": "./dist/browser/index.mjs"
36
36
  }
37
37
  },
38
38
  "node": {
@@ -42,14 +42,14 @@
42
42
  },
43
43
  "import": {
44
44
  "types": "./dist/node/index.d.mts",
45
- "default": "./dist/node/index.js"
45
+ "default": "./dist/node/index.mjs"
46
46
  }
47
47
  }
48
48
  },
49
49
  "./package.json": "./package.json"
50
50
  },
51
51
  "main": "dist/node/index.cjs",
52
- "module": "dist/node/index.js",
52
+ "module": "dist/node/index.mjs",
53
53
  "homepage": "https://xyo.network",
54
54
  "license": "LGPL-3.0-only",
55
55
  "publishConfig": {
@@ -61,6 +61,6 @@
61
61
  },
62
62
  "sideEffects": false,
63
63
  "types": "dist/node/index.d.ts",
64
- "version": "2.110.18",
64
+ "version": "2.111.0",
65
65
  "type": "module"
66
66
  }
@@ -41,9 +41,11 @@ export class StoragePreviousHashStore implements PreviousHashStore {
41
41
  const value = await this.storage.get(address)
42
42
  return value ?? null
43
43
  }
44
+
44
45
  async removeItem(address: Address): Promise<void> {
45
46
  await this.storage.remove(address)
46
47
  }
48
+
47
49
  async setItem(address: Address, previousHash: Hash): Promise<void> {
48
50
  await this.storage.set(address, previousHash)
49
51
  }