@iebh/polyglot 4.9.2 → 4.9.4

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.
@@ -183,16 +183,13 @@ var parse = function parse(query, options) {
183
183
  // $1
184
184
  branch.nodes.push({
185
185
  type: 'dollarOne',
186
- ref: [match[2]],
187
- cond: match[2] ? match[2].toUpperCase() : '',
186
+ ref: [match[0]],
187
+ cond: match[0] ? match[0].toUpperCase() : '',
188
188
  nodes: []
189
189
  });
190
- var index = q.indexOf(match[0]);
191
- if (index !== -1) {
192
- offset += index + 2;
193
- q = q.slice(0, index) + q.slice(index + 2);
194
- cropString = false;
195
- }
190
+ offset += match.index + match[0].length;
191
+ q = q.substr(match.index + match[0].length);
192
+ cropString = false;
196
193
  } else if (/^\(/.test(q)) {
197
194
  var newGroup = {
198
195
  type: 'group',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/polyglot",
3
- "version": "4.9.2",
3
+ "version": "4.9.4",
4
4
  "description": "IEBH-SRA tool to convert between different medical database search formats",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {