@diory/client-js 0.4.4-rc11 → 0.4.4-rc12
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.
|
@@ -9,11 +9,11 @@ const resolveConnection = (address) => {
|
|
|
9
9
|
const addressArray = (address || '').split('/') || [];
|
|
10
10
|
return {
|
|
11
11
|
client: addressArray[0],
|
|
12
|
-
root: addressArray.slice(1, -1).join('/')
|
|
12
|
+
root: `/${addressArray.slice(1, -1).join('/')}`,
|
|
13
13
|
id: addressArray[addressArray.length - 1],
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
const getDiographKey = (connection) => `${connection.client}
|
|
16
|
+
const getDiographKey = (connection) => `${connection.client}${connection.root}/`;
|
|
17
17
|
const findDataClient = (dataClients, client) => {
|
|
18
18
|
return dataClients.find(({ type }) => type === client);
|
|
19
19
|
};
|
|
@@ -24,7 +24,6 @@ class DioryClient {
|
|
|
24
24
|
this.addDiograph = (address, diographObject) => {
|
|
25
25
|
const connection = resolveConnection(address);
|
|
26
26
|
const diographKey = getDiographKey(connection);
|
|
27
|
-
console.log(address, connection, diographKey);
|
|
28
27
|
this.diographs[diographKey] = new diograph_1.Diograph(this.saveDiograph(address)).addDiograph(diographObject);
|
|
29
28
|
return this;
|
|
30
29
|
};
|
package/package.json
CHANGED
|
@@ -11,12 +11,12 @@ const resolveConnection = (address: string): IConnectionObject => {
|
|
|
11
11
|
const addressArray = (address || '').split('/') || []
|
|
12
12
|
return {
|
|
13
13
|
client: addressArray[0],
|
|
14
|
-
root: addressArray.slice(1, -1).join('/')
|
|
14
|
+
root: `/${addressArray.slice(1, -1).join('/')}`,
|
|
15
15
|
id: addressArray[addressArray.length - 1],
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const getDiographKey = (connection: IConnectionObject) => `${connection.client}
|
|
19
|
+
const getDiographKey = (connection: IConnectionObject) => `${connection.client}${connection.root}/`
|
|
20
20
|
|
|
21
21
|
const findDataClient = (dataClients: IDataClient[], client: string): IDataClient | undefined => {
|
|
22
22
|
return dataClients.find(({ type }) => type === client)
|
|
@@ -35,7 +35,6 @@ export class DioryClient implements IDioryClient {
|
|
|
35
35
|
addDiograph = (address: string, diographObject: IDiographObject): IDioryClient => {
|
|
36
36
|
const connection = resolveConnection(address)
|
|
37
37
|
const diographKey = getDiographKey(connection)
|
|
38
|
-
console.log(address, connection, diographKey)
|
|
39
38
|
this.diographs[diographKey] = new Diograph(this.saveDiograph(address)).addDiograph(
|
|
40
39
|
diographObject,
|
|
41
40
|
)
|