@iebh/polyglot 4.6.2 → 4.6.3

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.
@@ -178,6 +178,20 @@ var parse = function parse(query, options) {
178
178
  offset += match[0].length;
179
179
  q = q.substr(match[0].length);
180
180
  cropString = false;
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 ');
186
+ branch.nodes.push({
187
+ type: 'ref',
188
+ ref: refNumbers,
189
+ cond: 'OR',
190
+ nodes: []
191
+ });
192
+ offset += match[0].length;
193
+ q = q.substr(match[0].length);
194
+ cropString = false;
181
195
  } else if (match = /^(#?([0-9]+)) +(AND|OR|NOT)\s+/i.exec(q)) {
182
196
  // 1 AND ...
183
197
  if (leaf.type != "phrase") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/polyglot",
3
- "version": "4.6.2",
3
+ "version": "4.6.3",
4
4
  "description": "IEBH-SRA tool to convert between different medical database search formats",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {