@cocreate/utils 1.12.5 → 1.12.7

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,17 @@
1
+ ## [1.12.7](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.12.6...v1.12.7) (2022-11-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump dependencies ([36a7c1c](https://github.com/CoCreate-app/CoCreate-utils/commit/36a7c1c273c6767f6202241659172fd76ebd452a))
7
+
8
+ ## [1.12.6](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.12.5...v1.12.6) (2022-11-28)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * if no query.length or no search.length return true ([67d40d1](https://github.com/CoCreate-app/CoCreate-utils/commit/67d40d14d4c2c6c21aa83c6ec0aca575efeaec08))
14
+
1
15
  ## [1.12.5](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.12.4...v1.12.5) (2022-11-28)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/utils",
3
- "version": "1.12.5",
3
+ "version": "1.12.7",
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",
@@ -61,6 +61,6 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/docs": "^1.4.7"
64
+ "@cocreate/docs": "^1.4.8"
65
65
  }
66
66
  }
package/src/utils.js CHANGED
@@ -252,8 +252,12 @@
252
252
  let flag = true;
253
253
  if (!item)
254
254
  return false;
255
+ if (!query.length)
256
+ return true;
255
257
 
256
- if (Array.isArray(item)) return false;
258
+ if (Array.isArray(item))
259
+ return false;
260
+
257
261
  for (let i = 0; i < query.length; i++) {
258
262
  let fieldValue = item[query[i].name];
259
263
  if (fieldValue == undefined)
@@ -315,7 +319,8 @@
315
319
  function searchData(data, searches) {
316
320
  const search = searches['value']
317
321
  const operator = searches['type']
318
-
322
+ if (!search.length)
323
+ return true
319
324
  for (var key in data) {
320
325
  let value = data[key];
321
326
  let status = false;