@iebh/polyglot 4.6.3 → 4.6.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.
@@ -179,19 +179,29 @@ var parse = function parse(query, options) {
179
179
  q = q.substr(match[0].length);
180
180
  cropString = false;
181
181
  } else if (match = /^(OR)\/([0-9]+(?:,[0-9]+)*)/i.exec(q)) {
182
- // OR/11,14,..
183
- var refNumbers = match[2].split(',').map(function (num) {
184
- return "#".concat(num.trim());
185
- }).join(' OR ');
182
+ // OR/1,3
186
183
  branch.nodes.push({
187
184
  type: 'ref',
188
- ref: refNumbers,
189
- cond: 'OR',
185
+ ref: match[2].split(','),
186
+ cond: match[1].toUpperCase(),
190
187
  nodes: []
191
188
  });
192
189
  offset += match[0].length;
193
190
  q = q.substr(match[0].length);
194
191
  cropString = false;
192
+ // } else if (match = /^(OR)\/([0-9]+(?:,[0-9]+)*)/i.exec(q)) {
193
+ // // OR/11,14,..
194
+ // const refNumbers = match[2].split(',').map(num => `#${num.trim()}`).join(' OR ');
195
+
196
+ // branch.nodes.push({
197
+ // type: 'ref',
198
+ // ref: refNumbers,
199
+ // cond: 'OR',
200
+ // nodes: []
201
+ // });
202
+ // offset += match[0].length;
203
+ // q = q.substr(match[0].length);
204
+ // cropString = false;
195
205
  } else if (match = /^(#?([0-9]+)) +(AND|OR|NOT)\s+/i.exec(q)) {
196
206
  // 1 AND ...
197
207
  if (leaf.type != "phrase") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/polyglot",
3
- "version": "4.6.3",
3
+ "version": "4.6.4",
4
4
  "description": "IEBH-SRA tool to convert between different medical database search formats",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {