@dynamic-labs/utils 1.1.0-alpha.3 → 1.1.0-alpha.4
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/CHANGELOG.md +9 -0
- package/package.json +3 -3
- package/src/localStorageAsync.cjs +11 -2
- package/src/localStorageAsync.d.ts +2 -2
- package/src/localStorageAsync.js +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.1.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.3...v1.1.0-alpha.4) (2023-12-21)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add bitcoin integration ([#4216](https://github.com/dynamic-labs/DynamicAuth/issues/4216)) ([9584f1c](https://github.com/dynamic-labs/DynamicAuth/commit/9584f1cc3133835049ad1c53da980192263b8f21))
|
|
8
|
+
* add default footer to wallet list when tos and pp not enabled ([#4224](https://github.com/dynamic-labs/DynamicAuth/issues/4224)) ([0ad81c4](https://github.com/dynamic-labs/DynamicAuth/commit/0ad81c409bcb4aafb0dc565685525d620a95efce))
|
|
9
|
+
* adds useConnectWithEmailOtp ([#4234](https://github.com/dynamic-labs/DynamicAuth/issues/4234)) ([4a4e50a](https://github.com/dynamic-labs/DynamicAuth/commit/4a4e50ac8651c2a249d5125ae6bcf49aaf49be8c))
|
|
10
|
+
|
|
2
11
|
## [1.1.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.2...v1.1.0-alpha.3) (2023-12-19)
|
|
3
12
|
|
|
4
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"viem": "^1.19.13"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dynamic-labs/logger": "1.1.0-alpha.
|
|
33
|
-
"@dynamic-labs/types": "1.1.0-alpha.
|
|
32
|
+
"@dynamic-labs/logger": "1.1.0-alpha.4",
|
|
33
|
+
"@dynamic-labs/types": "1.1.0-alpha.4"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -8,13 +8,22 @@ const getItemAsync = (key) => _tslib.__awaiter(void 0, void 0, void 0, function*
|
|
|
8
8
|
if (typeof window === 'undefined') {
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
const value = window.localStorage.getItem(key);
|
|
12
|
+
if (!value) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(value);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
12
21
|
});
|
|
13
22
|
const setItemAsync = (key, value) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
23
|
if (typeof window === 'undefined') {
|
|
15
24
|
return undefined;
|
|
16
25
|
}
|
|
17
|
-
|
|
26
|
+
window.localStorage.setItem(key, JSON.stringify(value));
|
|
18
27
|
});
|
|
19
28
|
const removeItemAsync = (key) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
29
|
if (typeof window === 'undefined') {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const getItemAsync: (key: string) => Promise<
|
|
2
|
-
export declare const setItemAsync: (key: string, value:
|
|
1
|
+
export declare const getItemAsync: <T = string>(key: string) => Promise<T | undefined>;
|
|
2
|
+
export declare const setItemAsync: <T = string>(key: string, value: T) => Promise<void>;
|
|
3
3
|
export declare const removeItemAsync: (key: string) => Promise<void>;
|
package/src/localStorageAsync.js
CHANGED
|
@@ -4,13 +4,22 @@ const getItemAsync = (key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
4
4
|
if (typeof window === 'undefined') {
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
const value = window.localStorage.getItem(key);
|
|
8
|
+
if (!value) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(value);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
8
17
|
});
|
|
9
18
|
const setItemAsync = (key, value) => __awaiter(void 0, void 0, void 0, function* () {
|
|
10
19
|
if (typeof window === 'undefined') {
|
|
11
20
|
return undefined;
|
|
12
21
|
}
|
|
13
|
-
|
|
22
|
+
window.localStorage.setItem(key, JSON.stringify(value));
|
|
14
23
|
});
|
|
15
24
|
const removeItemAsync = (key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
25
|
if (typeof window === 'undefined') {
|