@iebh/polyglot 4.9.0 → 4.9.2

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