@dynamic-labs/utils 2.2.0-alpha.4 → 3.0.0-alpha.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.
- package/CHANGELOG.md +11 -0
- package/package.json +3 -3
- package/src/get/get.cjs +24 -0
- package/src/get/get.d.ts +7 -0
- package/src/get/get.js +20 -0
- package/src/get/index.d.ts +1 -0
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.0-alpha.5...v3.0.0-alpha.0) (2024-06-10)
|
|
3
|
+
|
|
4
|
+
## [2.2.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.0-alpha.4...v2.2.0-alpha.5) (2024-06-08)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* find solana provider from wallet standard ([#5897](https://github.com/dynamic-labs/DynamicAuth/issues/5897)) ([2144041](https://github.com/dynamic-labs/DynamicAuth/commit/21440410c3a75983195260ce57f4442177480c65))
|
|
10
|
+
* remove force consent and account selection even for returning google users ([#5911](https://github.com/dynamic-labs/DynamicAuth/issues/5911)) ([8b2a358](https://github.com/dynamic-labs/DynamicAuth/commit/8b2a3586ee559c553a1615a57c34226c175db2f9))
|
|
11
|
+
* retrieve connected account from cache when MagicEden wallet is secondary and locked ([#5885](https://github.com/dynamic-labs/DynamicAuth/issues/5885)) ([fb35a65](https://github.com/dynamic-labs/DynamicAuth/commit/fb35a651dc18dbdc2bfaad87b7528bfae977f7e3))
|
|
12
|
+
|
|
2
13
|
## [2.2.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.0-alpha.3...v2.2.0-alpha.4) (2024-06-06)
|
|
3
14
|
|
|
4
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@dynamic-labs/sdk-api-core": "0.0.460",
|
|
30
30
|
"tldts": "6.0.16",
|
|
31
|
-
"@dynamic-labs/logger": "
|
|
32
|
-
"@dynamic-labs/types": "
|
|
31
|
+
"@dynamic-labs/logger": "3.0.0-alpha.0",
|
|
32
|
+
"@dynamic-labs/types": "3.0.0-alpha.0",
|
|
33
33
|
"buffer": "6.0.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
package/src/get/get.cjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves the value at the given path of an object.
|
|
8
|
+
* @param obj - The object from which to extract the value.
|
|
9
|
+
* @param path - The path to the desired value within the object, using dot notation.
|
|
10
|
+
* @returns The value from the specified path, or undefined if the path is not valid.
|
|
11
|
+
*/
|
|
12
|
+
const get = (obj, path) => {
|
|
13
|
+
try {
|
|
14
|
+
// Split the path into keys considering special characters as part of the keys
|
|
15
|
+
const keys = path.match(/[^.[\]"']+/g) || [];
|
|
16
|
+
return keys.reduce((acc, key) => acc[key], obj);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
// If there is an error accessing the properties, return undefined
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.get = get;
|
package/src/get/get.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves the value at the given path of an object.
|
|
3
|
+
* @param obj - The object from which to extract the value.
|
|
4
|
+
* @param path - The path to the desired value within the object, using dot notation.
|
|
5
|
+
* @returns The value from the specified path, or undefined if the path is not valid.
|
|
6
|
+
*/
|
|
7
|
+
export declare const get: <T = any>(obj: Record<string, any>, path: string) => T | undefined;
|
package/src/get/get.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves the value at the given path of an object.
|
|
4
|
+
* @param obj - The object from which to extract the value.
|
|
5
|
+
* @param path - The path to the desired value within the object, using dot notation.
|
|
6
|
+
* @returns The value from the specified path, or undefined if the path is not valid.
|
|
7
|
+
*/
|
|
8
|
+
const get = (obj, path) => {
|
|
9
|
+
try {
|
|
10
|
+
// Split the path into keys considering special characters as part of the keys
|
|
11
|
+
const keys = path.match(/[^.[\]"']+/g) || [];
|
|
12
|
+
return keys.reduce((acc, key) => acc[key], obj);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
// If there is an error accessing the properties, return undefined
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { get };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { get } from './get';
|
package/src/index.cjs
CHANGED
|
@@ -60,6 +60,7 @@ var PlatformService = require('./services/PlatformService/PlatformService.cjs');
|
|
|
60
60
|
var createBrowserPlatformService = require('./services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.cjs');
|
|
61
61
|
var FetchService = require('./services/FetchService/FetchService.cjs');
|
|
62
62
|
var template = require('./template/template.cjs');
|
|
63
|
+
var get = require('./get/get.cjs');
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
|
|
@@ -134,3 +135,4 @@ exports.PlatformService = PlatformService.PlatformService;
|
|
|
134
135
|
exports.createBrowserPlatformService = createBrowserPlatformService.createBrowserPlatformService;
|
|
135
136
|
exports.FetchService = FetchService.FetchService;
|
|
136
137
|
exports.template = template.template;
|
|
138
|
+
exports.get = get.get;
|
package/src/index.d.ts
CHANGED
|
@@ -25,3 +25,4 @@ export { runSafe } from './runSafe';
|
|
|
25
25
|
export { PlatformService, createBrowserPlatformService, type IPlatformService, } from './services/PlatformService';
|
|
26
26
|
export { FetchService } from './services/FetchService';
|
|
27
27
|
export { template } from './template';
|
|
28
|
+
export { get } from './get';
|
package/src/index.js
CHANGED
|
@@ -56,3 +56,4 @@ export { PlatformService } from './services/PlatformService/PlatformService.js';
|
|
|
56
56
|
export { createBrowserPlatformService } from './services/PlatformService/createBrowserPlatformService/createBrowserPlatformService.js';
|
|
57
57
|
export { FetchService } from './services/FetchService/FetchService.js';
|
|
58
58
|
export { template } from './template/template.js';
|
|
59
|
+
export { get } from './get/get.js';
|