@zengenti/contensis-react-base 3.0.0-beta.51 → 3.0.0-beta.52

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.
package/cjs/search.js CHANGED
@@ -878,7 +878,7 @@ const Fields = {
878
878
  };
879
879
 
880
880
  const fieldExpression = (field, value, operator = 'equalTo', weight) => {
881
- if (!field || !value) return [];
881
+ if (!field || !value || Array.isArray(value) && value.length === 0) return [];
882
882
  if (Array.isArray(field)) // If an array of fieldIds have been provided, call self for each fieldId
883
883
  // to generate expressions that are combined with an 'or' operator
884
884
  return [contensisCoreApi.Op.or(...field.map(fieldId => fieldExpression(fieldId, value, operator, weight)).flat())];