pathchain 1.0.38 → 1.0.40

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 (3) hide show
  1. package/index.js +2 -2
  2. package/maker.js +11 -11
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -191,8 +191,8 @@ exports.getNodeObj = (xnode, xauthor="") => {
191
191
  *
192
192
  * @return {string} path_buffer
193
193
  */
194
- exports.makePath = (xauthor = "", text ="", head="", ancestor="", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
195
- const path_buffer = maker.path(xauthor, text, head, ancestor, format);
194
+ exports.makePath = (text ="", head="", xauthor = "", ancestor="", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
195
+ const path_buffer = maker.path(text, head, xauthor, ancestor, format);
196
196
  return path_buffer;
197
197
  }
198
198
 
package/maker.js CHANGED
@@ -260,7 +260,7 @@ function node(text, author, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
260
260
  *
261
261
  * @return {string} path_hash
262
262
  */
263
- function path(author, text, head, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
263
+ function path(text, head, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
264
264
  var path_pb = pb(fs.readFileSync('node_modules/pathchain/proto/path.proto'))
265
265
 
266
266
  var author_folder = author;
@@ -286,15 +286,15 @@ function path(author, text, head, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]
286
286
  register: "moments/"+register_moment_hash,
287
287
  author: author,
288
288
  text: text,
289
- head: head,
290
- ancestor: ancestor,
291
- tag: "paths/"+path_hash,
289
+ head: "nodelinks/" + head,
290
+ ancestor: author_folder + "paths/" + ancestor,
291
+ tag: author_folder + "paths/" + path_hash,
292
292
  })
293
293
 
294
294
  checker.checkDir("files/" + author_folder + "paths/") // checking
295
295
  fs.writeFileSync("files/" + author_folder + "paths/" + path_hash, buffer);
296
296
 
297
- return author_folder + "/paths/" + path_hash;
297
+ return path_hash;
298
298
  }
299
299
 
300
300
 
@@ -334,8 +334,8 @@ function label(text, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
334
334
  register: "moments/" + register_moment_hash,
335
335
  author: "etities/" + author,
336
336
  text: text,
337
- ancestor: ancestor,
338
- tag: "labels/" + label_hash
337
+ ancestor: author_folder + "labels/" + ancestor,
338
+ tag: author_folder + "labels/" + label_hash
339
339
  })
340
340
 
341
341
  checker.checkDir("files/" + author_folder + "labels/") // checking
@@ -381,10 +381,10 @@ function nodelink(first, second, author, ancestor, format = 'MM DD YYYY HH:mm:SS
381
381
  var buffer = nodelink_pb.nodelink.encode({
382
382
  register: "moments/" + register_moment_hash,
383
383
  author: "etities/" + author,
384
- first: first,
385
- second: second,
386
- ancestor: ancestor,
387
- tag: "nodelinks/" + nodelink_hash
384
+ first: "nodes/" + first,
385
+ second: "nodes/" + second,
386
+ ancestor: author_folder + "nodelinks/" + ancestor,
387
+ tag: author_folder + "nodelinks/" + nodelink_hash
388
388
  })
389
389
 
390
390
  checker.checkDir("files/" + author_folder + "nodelinks/") // checking
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pathchain",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "dependencies": {
5
5
  "date-and-time": "^3.0.2",
6
6
  "empty-dir": "^3.0.0",