pathchain 1.1.37 → 1.1.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/README.md +61 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -740,14 +740,28 @@ var path_chain_obj = pathchain.getPathchainObj(path_buff);
|
|
|
740
740
|
console.log("Path chain obj: ", path_chain_obj);
|
|
741
741
|
```
|
|
742
742
|
|
|
743
|
-
|
|
744
|
-
```
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
743
|
+
Console:
|
|
744
|
+
``` bash
|
|
745
|
+
Pathchain object: [
|
|
746
|
+
{
|
|
747
|
+
register: 'moments/253414143d338fc68096a0e3710caf0874056ccebab0c5440cc1d2316b696814',
|
|
748
|
+
author: 'entities/23223e7b9a2e98456d42963de23a165c43248e1430adfaf4fd461959a109306c',
|
|
749
|
+
text: 'This is the content of a third public node',
|
|
750
|
+
tag: 'nodes/415024cff8dd263b3252592903b5d8f098298a0eed3ab67f372ea305cf2e137b'
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
register: 'moments/86e1a2571fb12fa4af49f43ead01819b85376564e017bda6f656cde6d33dc070',
|
|
754
|
+
author: 'entities/23223e7b9a2e98456d42963de23a165c43248e1430adfaf4fd461959a109306c',
|
|
755
|
+
text: 'This is the content of a second public node',
|
|
756
|
+
tag: 'nodes/0d1686603951c3e92a3122375d27a6ead4c3131d81fd321aee04c4729657b41d'
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
register: 'moments/897a9171765ca68fb5aa264b41040e107d741307918e1acd6dda2dbea36d7dfc',
|
|
760
|
+
author: 'entities/23223e7b9a2e98456d42963de23a165c43248e1430adfaf4fd461959a109306c',
|
|
761
|
+
text: 'This is the content of a public node',
|
|
762
|
+
tag: 'nodes/480cd79de90f3cd6d5aabd7847d0eb8ed416eb5c1054e27866e29524e6da754e'
|
|
763
|
+
}
|
|
764
|
+
]
|
|
751
765
|
```
|
|
752
766
|
|
|
753
767
|
## Label
|
|
@@ -833,3 +847,42 @@ var obj = pathchain.getObj(node_buff);
|
|
|
833
847
|
|
|
834
848
|
console.log("Object: ", obj);
|
|
835
849
|
```
|
|
850
|
+
|
|
851
|
+
Console:
|
|
852
|
+
```bash
|
|
853
|
+
Retrieving object of type: nodes
|
|
854
|
+
Object: {
|
|
855
|
+
register: 'moments/253414143d338fc68096a0e3710caf0874056ccebab0c5440cc1d2316b696814',
|
|
856
|
+
author: 'entities/23223e7b9a2e98456d42963de23a165c43248e1430adfaf4fd461959a109306c',
|
|
857
|
+
text: 'This is the content of a third public node',
|
|
858
|
+
tag: 'nodes/415024cff8dd263b3252592903b5d8f098298a0eed3ab67f372ea305cf2e137b'
|
|
859
|
+
}
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
#### Generic Object Type getter
|
|
864
|
+
|
|
865
|
+
Parameter rules:
|
|
866
|
+
|Parameter |Required |
|
|
867
|
+
|-------------------------|----------|
|
|
868
|
+
|{string} xaddress |(required)|
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
---
|
|
872
|
+
Summoning `getType(xaddress)`:
|
|
873
|
+
```javascript
|
|
874
|
+
const pathchain = require("pathchain"); // Summoning pathchain
|
|
875
|
+
|
|
876
|
+
// Having the tag/address of any object from the pathchain
|
|
877
|
+
var buff_address = "nodes/415024cff8dd263b3252592903b5d8f098298a0eed3ab67f372ea305cf2e137b"
|
|
878
|
+
|
|
879
|
+
// Infer its type!
|
|
880
|
+
var buff_type = pathchain.getType(buff_address);
|
|
881
|
+
|
|
882
|
+
console.log("Type: ", buff_type);
|
|
883
|
+
```
|
|
884
|
+
|
|
885
|
+
Console:
|
|
886
|
+
```bash
|
|
887
|
+
Type: node
|
|
888
|
+
```
|
package/package.json
CHANGED