pathchain 1.0.28 → 1.0.30

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 +3 -3
  2. package/maker.js +4 -4
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -164,8 +164,8 @@ exports.getSecretObj = (xsecret, xauthor = "") => {
164
164
  *
165
165
  * @return {string} node_buffer
166
166
  */
167
- exports.makeNode = (xauthor = "", text ="", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
168
- const node_buffer = maker.node(xauthor, text, format);
167
+ exports.makeNode = (text ="", xauthor = "", format = 'MM DD YYYY HH:mm:SSS [GMT]Z') => {
168
+ const node_buffer = maker.node(text, xauthor, format);
169
169
  return node_buffer;
170
170
  }
171
171
 
@@ -179,4 +179,4 @@ exports.makeNode = (xauthor = "", text ="", format = 'MM DD YYYY HH:mm:SSS [GMT]
179
179
  exports.getNodeObj = (xnode, xauthor="") => {
180
180
  const node_object = getter.getNodeObj(xnode, xauthor);
181
181
  return node_object;
182
- }
182
+ }
package/maker.js CHANGED
@@ -216,7 +216,7 @@ function entity(xsecret, format) {
216
216
  *
217
217
  * @return {string} node_hash
218
218
  */
219
- function node(author, text, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
219
+ function node(text, author, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
220
220
  var node_pb = pb(fs.readFileSync('node_modules/pathchain/proto/node.proto'))
221
221
 
222
222
  var author_folder = author;
@@ -230,15 +230,15 @@ function node(author, text, format = 'MM DD YYYY HH:mm:SSS [GMT]Z') {
230
230
  var register = new Date()
231
231
  register = dt.format(register, dt.compile(format, true));
232
232
 
233
- var register_moment_hash = moment(register, format, 0, 0, 0, 0, 0)
233
+ var register_moment_hash = moment(register, 0, 0, 0, 0, 0, format)
234
234
 
235
235
  var node_hash = sha256(register_moment_hash + "_" + author);
236
236
 
237
237
  var buffer = node_pb.node.encode({
238
- register: "moments/"+register_moment_hash,
238
+ register: "moments/" + register_moment_hash,
239
239
  author: author,
240
240
  text: text,
241
- tag: "nodes/"+node_hash,
241
+ tag: "nodes/" + node_hash
242
242
  })
243
243
 
244
244
  checker.checkDir("files/" + author_folder + "nodes/") // checking
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pathchain",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "dependencies": {
5
5
  "date-and-time": "^3.0.2",
6
6
  "empty-dir": "^3.0.0",