Conversation
| } | ||
| let properties = await this.parseEntityProperties(cell[2]); | ||
| let node = new Node(label, properties); | ||
| let node = new Node(labels, properties); |
There was a problem hiding this comment.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| if (cell[1].length == 1) { | ||
| labels = await this.parseNodeLabel(cell[1][0]); | ||
| } else { | ||
| labels = await Promise.all(cell[1].map(x => this.parseNodeLabel(x))); |
There was a problem hiding this comment.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Missing semicolon.
| let node_id = cell[0]; | ||
| var labels = undefined; | ||
| if (cell[1].length == 1) { | ||
| labels = await this.parseNodeLabel(cell[1][0]); |
| // [[name, value, value type] X N] | ||
|
|
||
| let node_id = cell[0]; | ||
| var labels = undefined; |
There was a problem hiding this comment.
It's not necessary to initialize 'labels' to 'undefined'.
| // [label string offset (integer) X N], | ||
| // [[name, value, value type] X N] | ||
|
|
||
| let node_id = cell[0]; |
There was a problem hiding this comment.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| * @param {object[]} cell raw node representation. | ||
| * @returns {Promise<Node>} Node object. | ||
| */ | ||
| async parseNode(cell) { |
There was a problem hiding this comment.
Class properties must be methods. Expected '(' but instead saw 'parseNode'.
Duplicate class method 'async'.
| var tries = 0; | ||
| while (label == undefined && tries < 10) { | ||
| label = await this._graph.fetchAndGetLabel(cell[1][0]); | ||
| label = await this._graph.fetchAndGetLabel(label_idx); |
| let node_id = cell[0]; | ||
| let label = this._graph.getLabel(cell[1][0]); | ||
| async parseNodeLabel(label_idx) { | ||
| let label = this._graph.getLabel(label_idx); |
There was a problem hiding this comment.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
|
||
| let node_id = cell[0]; | ||
| let label = this._graph.getLabel(cell[1][0]); | ||
| async parseNodeLabel(label_idx) { |
There was a problem hiding this comment.
Class properties must be methods. Expected '(' but instead saw 'parseNodeLabel'.
Duplicate class method 'async'.
Codecov Report
@@ Coverage Diff @@
## master #82 +/- ##
=======================================
Coverage 90.74% 90.74%
=======================================
Files 6 6
Lines 108 108
Branches 6 6
=======================================
Hits 98 98
Misses 10 10
Continue to review full report at Codecov.
|
This PR allows nodes to be created and parsed with an array of label string as well as with a label string (for backwards compatibility).
This should not break existing functionality, but adds the ability to have multiple labels on a given node.