pathchain 1.1.35 → 1.1.37
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/getter.js +7 -10
- package/package.json +1 -1
package/getter.js
CHANGED
|
@@ -166,7 +166,7 @@ function getObj(xaddress) {
|
|
|
166
166
|
const filePath = `files/${xaddress}`;
|
|
167
167
|
|
|
168
168
|
var splitted_address = xaddress.split("/");
|
|
169
|
-
console.log("Splitted address: ", splitted_address);
|
|
169
|
+
// console.log("Splitted address: ", splitted_address);
|
|
170
170
|
var obj_type = splitted_address[splitted_address.length - 2];
|
|
171
171
|
console.log("Retrieving object of type: ", obj_type);
|
|
172
172
|
|
|
@@ -275,26 +275,23 @@ function getPathchainObj(xpath, xauthor = '') {
|
|
|
275
275
|
var pathObj = pathProto.path.decode(fileContents);
|
|
276
276
|
|
|
277
277
|
var head_link = this.getObj(pathObj.head);
|
|
278
|
-
console.log("Head link", head_link);
|
|
279
|
-
|
|
280
|
-
var head_obj = this.getObj(head_link.target);
|
|
281
|
-
console.log("Head target object", head_obj);
|
|
282
|
-
|
|
278
|
+
// console.log("Head link", head_link);
|
|
279
|
+
|
|
283
280
|
var obj_list = [];
|
|
284
281
|
var current_link = head_link;
|
|
285
282
|
|
|
286
283
|
// As the head is the last inserted element, we go backwards till there's no more linked elements
|
|
287
284
|
while (current_link.prev !== current_link.tag) {
|
|
288
|
-
console.log("Current link: ", current_link);
|
|
289
|
-
console.log("Trying to retrieve object from: ", current_link.target);
|
|
285
|
+
// console.log("Current link: ", current_link);
|
|
286
|
+
// console.log("Trying to retrieve object from: ", current_link.target);
|
|
290
287
|
const current_obj = this.getObj(current_link.target);
|
|
291
288
|
console.log("Pushing object: ", current_obj);
|
|
292
289
|
obj_list.push(current_obj);
|
|
293
|
-
current_link = current_link.prev;
|
|
290
|
+
current_link = this.getObj(current_link.prev);
|
|
294
291
|
}
|
|
295
292
|
console.log("Pushing last element (current link target): ", current_link.target);
|
|
296
293
|
var current_link_target_obj = this.getObj(current_link.target);
|
|
297
|
-
console.log("
|
|
294
|
+
console.log("Last element target object: ", current_link_target_obj);
|
|
298
295
|
obj_list.push(current_link_target_obj);
|
|
299
296
|
|
|
300
297
|
return obj_list;
|
package/package.json
CHANGED