pathchain 1.0.42 → 1.0.43

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.
Files changed (2) hide show
  1. package/getter.js +12 -12
  2. package/package.json +1 -1
package/getter.js CHANGED
@@ -288,7 +288,7 @@ function getPathlinkObj(xpathlink, xauthor) {
288
288
  }
289
289
  }
290
290
 
291
- // DECODING NODE
291
+ // DECODING PATHLINK
292
292
  var pathlink_enc = fileContents
293
293
  var pathlink_obj = pathlink_pb.pathlink.decode(pathlink_enc)
294
294
 
@@ -324,7 +324,7 @@ function getTreeObj(xtree, xauthor) {
324
324
  }
325
325
  }
326
326
 
327
- // DECODING NODE
327
+ // DECODING TREE
328
328
  var tree_enc = fileContents
329
329
  var tree_obj = tree_pb.tree.decode(tree_enc)
330
330
 
@@ -333,25 +333,25 @@ function getTreeObj(xtree, xauthor) {
333
333
 
334
334
 
335
335
  /** getTreelinkObj
336
- * [Function that recieves a nodelink hash and returns the nodelink object]
336
+ * [Function that recieves a treelink hash and returns the treelink object]
337
337
  *
338
- * @param {string} xnodelink (required)
338
+ * @param {string} xtreelink (required)
339
339
  *
340
340
  * @return void
341
341
  */
342
- function getTreelinkObj(xnodelink, xauthor) {
342
+ function getTreelinkObj(treelink, xauthor) {
343
343
 
344
344
  if(xauthor != ""){
345
345
  xauthor = xauthor + '/';
346
346
  }
347
347
 
348
348
  // LOADING PB
349
- var nodelink_pb = pb(fs.readFileSync('node_modules/pathchain/proto/nodelink.proto'))
349
+ var treelink_pb = pb(fs.readFileSync('node_modules/pathchain/proto/treelink.proto'))
350
350
 
351
351
  // NOT FOUND EXCEPTION
352
352
  var fileContents;
353
353
  try {
354
- fileContents = fs.readFileSync("files/" + xauthor + "nodelinks/" + xnodelink);
354
+ fileContents = fs.readFileSync("files/" + xauthor + "treelinks/" + xtreelink);
355
355
  } catch (err) {
356
356
  if (err.code === 'ENOENT') {
357
357
  return "Treelink not found";
@@ -360,11 +360,11 @@ function getTreelinkObj(xnodelink, xauthor) {
360
360
  }
361
361
  }
362
362
 
363
- // DECODING NODE
364
- var nodelink_enc = fileContents
365
- var nodelink_obj = nodelink_pb.nodelink.decode(nodelink_enc)
363
+ // DECODING TREELINK
364
+ var treelink_enc = fileContents
365
+ var treelink_obj = treelink_pb.treelink.decode(treelink_enc)
366
366
 
367
- return nodelink_obj;
367
+ return treelink_obj;
368
368
  }
369
369
 
370
370
 
@@ -396,7 +396,7 @@ function getLabelObj(xlabel, xauthor) {
396
396
  }
397
397
  }
398
398
 
399
- // DECODING NODE
399
+ // DECODING LABEL
400
400
  var label_enc = fileContents
401
401
  var label_obj = label_pb.label.decode(label_enc)
402
402
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pathchain",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "dependencies": {
5
5
  "date-and-time": "^3.0.2",
6
6
  "empty-dir": "^3.0.0",