monoidentity 0.5.0 → 0.5.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/_createstore.d.ts +1 -1
- package/dist/_localstorage.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +11 -0
- package/package.json +1 -1
package/dist/_createstore.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ type ProxyHandlerWithoutTarget = {
|
|
|
6
6
|
deleteProperty?(p: string | symbol): boolean;
|
|
7
7
|
ownKeys?(): ArrayLike<string | symbol>;
|
|
8
8
|
};
|
|
9
|
-
export declare const createStore: (implementation: ProxyHandlerWithoutTarget) =>
|
|
9
|
+
export declare const createStore: <T>(implementation: ProxyHandlerWithoutTarget) => Record<string, T>;
|
|
10
10
|
export {};
|
package/dist/_localstorage.d.ts
CHANGED
package/dist/storage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Login } from "./utils-callback.js";
|
|
2
2
|
export declare const setup: (i: Record<string, string>, a: string) => void;
|
|
3
3
|
export declare const getLogin: () => Login;
|
|
4
|
-
export declare const getStorage: (realm: "config" | "cache") =>
|
|
4
|
+
export declare const getStorage: (realm: "config" | "cache") => Record<string, any>;
|
package/dist/storage.js
CHANGED
|
@@ -34,5 +34,16 @@ export const getStorage = (realm) => {
|
|
|
34
34
|
implementation[prefix(key)] = stringify(value);
|
|
35
35
|
return true;
|
|
36
36
|
},
|
|
37
|
+
has(key) {
|
|
38
|
+
if (!implementation)
|
|
39
|
+
throw new Error("No implementation set");
|
|
40
|
+
return prefix(key) in implementation;
|
|
41
|
+
},
|
|
42
|
+
deleteProperty(key) {
|
|
43
|
+
if (!implementation)
|
|
44
|
+
throw new Error("No implementation set");
|
|
45
|
+
const k = prefix(key);
|
|
46
|
+
return delete implementation[k];
|
|
47
|
+
},
|
|
37
48
|
});
|
|
38
49
|
};
|