gramene-search 1.2.24 → 1.2.25

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.
@@ -1,2 +1,2 @@
1
- 39701845
2
- 1649357861902487000
1
+ 61378806
2
+ 1649954728209027000
Binary file
Binary file
package/dist/index.js CHANGED
@@ -1033,6 +1033,7 @@ var $b8aee296158e1013$var$grameneFilters = {
1033
1033
  selectGrameneFiltersQueryString: function selectGrameneFiltersQueryString(state) {
1034
1034
  var hasSpaces = new RegExp(/^[^\[\(].*\s/);
1035
1035
  var isQuery = new RegExp(/\([a-zA-Z0-9_]+:[a-zA-Z0-9_]+\s/);
1036
+ var idWithColon = new RegExp(/^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$/);
1036
1037
  function getQuery(node) {
1037
1038
  var negate = node.negate ? 'NOT ' : '';
1038
1039
  if (node.hasOwnProperty('children')) // do some recursion
@@ -1042,8 +1043,9 @@ var $b8aee296158e1013$var$grameneFilters = {
1042
1043
  else {
1043
1044
  // this node is a suggestion
1044
1045
  if (isQuery.test(node.fq_value)) return "".concat(negate).concat(node.fq_value.replace(/:/g, '\\:'));
1045
- if (hasSpaces.test(node.fq_value)) return "".concat(negate).concat(node.fq_field, ":\"").concat(node.fq_value.replace(/:/g, '\\:'), "\"");
1046
- else return "".concat(negate).concat(node.fq_field, ":").concat(node.fq_value.replace(/:/g, '\\:'));
1046
+ if (hasSpaces.test(node.fq_value)) return "".concat(negate).concat(node.fq_field, ":\"").concat(node.fq_value, "\"");
1047
+ else if (idWithColon.test(node.fq_value)) return "".concat(negate).concat(node.fq_field, ":").concat(node.fq_value.replace(/:/g, '\\:'));
1048
+ else return "".concat(negate).concat(node.fq_field, ":").concat(node.fq_value);
1047
1049
  }
1048
1050
  }
1049
1051
  if (state.grameneFilters.rightIdx === 1) return '*:*';