@alwith/module-store 0.1.1 → 0.1.2
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.
- package/dist/index.js +1 -1
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function c(r){class n{scope;name;constructor(e,t){this.scope=e;this.name=t}entriesObject(){return r().storeEntries(this.scope,this.name)}async get(e){return(await this.entriesObject())[e]}async set(e,t){await r().storeSet(this.scope,this.name,e,t)}async has(e){return Object.hasOwn(await this.entriesObject(),e)}async delete(e){await r().storeDelete(this.scope,this.name,e)}async keys(){return Object.keys(await this.entriesObject())}async values(){return Object.values(await this.entriesObject())}async clear(){await r().storeClear(this.scope,this.name)}async reload(){await r().storeReload(this.scope,this.name)}async entries(){return Object.entries(await this.entriesObject())}async length(){return Object.keys(await this.entriesObject()).length}onKeyChange(e,t){return this.onChange((s,i)=>{if(s===e)t(i)})}onChange(e){return r().onStoreChanged((t)=>{if(t.store===this.name)e(t.key,t.value)})}}let o=new Map;function d(e,t="data"){let s=`${t}:${e}`,i=o.get(s);if(i)return i;let a=new n(t,e);return o.set(s,a),a}return{openStore:d}}export{c as createStoreClient};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwith/module-store",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "bun test src",
|
|
25
|
-
"typecheck": "tsc --noEmit",
|
|
26
25
|
"build": "bun ../../../scripts/build-npm.ts",
|
|
27
26
|
"prepack": "bun run build"
|
|
28
27
|
},
|