@iebh/polyglot 4.6.2 → 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.
@@ -178,6 +178,30 @@ 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/1,3
183
+ branch.nodes.push({
184
+ type: 'ref',
185
+ ref: match[2].split(','),
186
+ cond: match[1].toUpperCase(),
187
+ nodes: []
188
+ });
189
+ offset += match[0].length;
190
+ q = q.substr(match[0].length);
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;
181
205
  } else if (match = /^(#?([0-9]+)) +(AND|OR|NOT)\s+/i.exec(q)) {
182
206
  // 1 AND ...
183
207
  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.4",
4
4
  "description": "IEBH-SRA tool to convert between different medical database search formats",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {