pathchain 1.0.38 → 1.0.39
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/index.js +2 -2
- package/maker.js +10 -10
- 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 = (
|
|
195
|
-
const path_buffer = maker.path(
|
|
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(
|
|
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,9 +286,9 @@ 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
|
|
@@ -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
|