pathchain 1.0.36 → 1.0.38
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 +28 -3
- package/maker.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -209,6 +209,32 @@ exports.getPathObj = (xpath, xauthor="") => {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
|
|
212
|
+
////////////////////
|
|
213
|
+
/// LABEL ///
|
|
214
|
+
////////////////////
|
|
215
|
+
|
|
216
|
+
/** makeLabel
|
|
217
|
+
* [Label maker]
|
|
218
|
+
*
|
|
219
|
+
* @return {string} label_buffer
|
|
220
|
+
*/
|
|
221
|
+
exports.makeLabel = (text ="", xauthor = "", ancestor = "", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
|
|
222
|
+
const label_buffer = maker.label(text, xauthor, ancestor, format);
|
|
223
|
+
return label_buffer;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** getLabelObj
|
|
227
|
+
* [Function that recieves a label hash and returns the label object]
|
|
228
|
+
*
|
|
229
|
+
* @param {string} xlabel (required)
|
|
230
|
+
*
|
|
231
|
+
* @return {obj} label_object (label object)
|
|
232
|
+
*/
|
|
233
|
+
exports.getLabelObj = (xlabel, xauthor="") => {
|
|
234
|
+
const label_object = getter.getLabelObj(xlabel, xauthor);
|
|
235
|
+
return label_object;
|
|
236
|
+
}
|
|
237
|
+
|
|
212
238
|
///////////////////////
|
|
213
239
|
/// NODELINK ///
|
|
214
240
|
///////////////////////
|
|
@@ -218,8 +244,8 @@ exports.getPathObj = (xpath, xauthor="") => {
|
|
|
218
244
|
*
|
|
219
245
|
* @return {string} nodelink_buffer
|
|
220
246
|
*/
|
|
221
|
-
exports.makeNodelink = (
|
|
222
|
-
const nodelink_buffer = maker.nodelink(
|
|
247
|
+
exports.makeNodelink = (first="", second="", xauthor = "", ancestor = "", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
|
|
248
|
+
const nodelink_buffer = maker.nodelink(first, second, xauthor, ancestor, format);
|
|
223
249
|
return nodelink_buffer;
|
|
224
250
|
}
|
|
225
251
|
|
|
@@ -235,4 +261,3 @@ exports.getNodelinkObj = (xnodelink, xauthor="") => {
|
|
|
235
261
|
return nodelink_object;
|
|
236
262
|
}
|
|
237
263
|
|
|
238
|
-
|
package/maker.js
CHANGED
|
@@ -354,7 +354,7 @@ function label(text, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
|
|
|
354
354
|
*
|
|
355
355
|
* @return {string} nodelink_hash
|
|
356
356
|
*/
|
|
357
|
-
function nodelink(
|
|
357
|
+
function nodelink(first, second, author, ancestor, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
|
|
358
358
|
var nodelink_pb = pb(fs.readFileSync('node_modules/pathchain/proto/nodelink.proto'))
|
|
359
359
|
|
|
360
360
|
if(first == "" || second == "") return "Two nodes are required to create a nodelink";
|