@cocreate/utils 1.17.26 → 1.18.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.18.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.17.26...v1.18.0) (2023-01-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * supports query and search of empty string. ([b3e45e8](https://github.com/CoCreate-app/CoCreate-utils/commit/b3e45e81b27f595d0179f6e01af5555e9315cfa2))
7
+
1
8
  ## [1.17.26](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.17.25...v1.17.26) (2023-01-30)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/utils",
3
- "version": "1.17.26",
3
+ "version": "1.18.0",
4
4
  "description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "utils",
package/src/utils.js CHANGED
@@ -336,6 +336,10 @@
336
336
  case 'includes':
337
337
  if (dataValue.includes(queryValue))
338
338
  queryStatus = true
339
+ if (queryValue === "" && logicalOperator === 'and') {
340
+ if (dataValue !== "")
341
+ queryStatus = false
342
+ }
339
343
  break;
340
344
  case '$eq':
341
345
  if (dataValue == queryValue)
@@ -436,6 +440,11 @@
436
440
  if (search[i].caseSensitive != 'true' || search[i].caseSensitive != true)
437
441
  searchString = searchString.toLowerCase()
438
442
 
443
+ if (searchString === "" && search[i].operator === 'and') {
444
+ if (value !== "")
445
+ return false
446
+ }
447
+
439
448
  if (value.indexOf(searchString) > -1)
440
449
  status = true;
441
450