pathchain 1.1.27 → 1.1.29
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 +5 -3
- 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
|
|
|
@@ -208,7 +208,7 @@ function getObj(xaddress) {
|
|
|
208
208
|
*/
|
|
209
209
|
function getType(xaddress) {
|
|
210
210
|
var splitted_address = xaddress.split("/");
|
|
211
|
-
console.log("Splitted address: ", splitted_address);
|
|
211
|
+
// console.log("Splitted address: ", splitted_address);
|
|
212
212
|
var obj_type = splitted_address[splitted_address.length - 2];
|
|
213
213
|
console.log("Retrieving object of type: ", obj_type);
|
|
214
214
|
|
|
@@ -284,10 +284,12 @@ function getPathchainObj(xpath, xauthor = '') {
|
|
|
284
284
|
let current_link = head_link;
|
|
285
285
|
|
|
286
286
|
// As the head is the last inserted element, we go backwards till there's no more linked elements
|
|
287
|
-
while (current_link.prev
|
|
287
|
+
while (current_link.prev != current_link.tag) {
|
|
288
288
|
obj_list.push(this.getObj(current_link.target));
|
|
289
289
|
current_link = current_link.prev;
|
|
290
290
|
}
|
|
291
|
+
// Push the last element
|
|
292
|
+
obj_list.push(this.getObj(current_link.target));
|
|
291
293
|
|
|
292
294
|
return obj_list;
|
|
293
295
|
} catch (err) {
|
package/package.json
CHANGED