@arsedizioni/ars-utils 21.1.55 → 21.1.57

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.
@@ -2118,14 +2118,14 @@ class ClipperSearchUtils {
2118
2118
  * @param queries : the new query
2119
2119
  */
2120
2120
  static concatTextQuery(q, queries) {
2121
- if (q && q.length > 0) {
2122
- if (queries.length == 0 && (q[0] === '+' || q[0] === '-'))
2123
- q = q.substring(1);
2124
- if (q[q.length - 1] !== '\"' && q.indexOf(' ') !== -1)
2121
+ if (q && q.length > 1) {
2122
+ if ((q[0] === '+' || q[0] === '-') && q[1] !== '"') {
2123
+ q = q[0] + '"' + q.substring(1) + '"';
2124
+ }
2125
+ else if (q[0] !== '"') {
2125
2126
  q = "\"" + q + "\"";
2126
- if (queries.length > 0)
2127
- queries += ", ";
2128
- queries += q;
2127
+ }
2128
+ queries += q + " ";
2129
2129
  }
2130
2130
  return queries;
2131
2131
  }