@cocreate/utils 1.16.1 → 1.16.3
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 +15 -0
- package/package.json +2 -2
- package/src/utils.js +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.16.3](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.16.2...v1.16.3) (2022-12-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump dependencies ([c67f136](https://github.com/CoCreate-app/CoCreate-utils/commit/c67f136bd3438c2977251e322a9bc51cd8efed3d))
|
|
7
|
+
|
|
8
|
+
## [1.16.2](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.16.1...v1.16.2) (2022-12-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* query operator includes and $includes ([c3cbafe](https://github.com/CoCreate-app/CoCreate-utils/commit/c3cbafe2751387de0a8a28cd0bb284eb19ce651d))
|
|
14
|
+
* sort direction uses key word asc desc ([87870b0](https://github.com/CoCreate-app/CoCreate-utils/commit/87870b005720d4d723fb194a5c876acd1b6f1c41))
|
|
15
|
+
|
|
1
16
|
## [1.16.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.16.0...v1.16.1) (2022-12-12)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/utils",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.3",
|
|
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.
|
|
64
|
+
"@cocreate/docs": "^1.4.19"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/utils.js
CHANGED
|
@@ -322,6 +322,7 @@
|
|
|
322
322
|
|
|
323
323
|
switch (query[i].operator) {
|
|
324
324
|
case '$includes':
|
|
325
|
+
case 'includes':
|
|
325
326
|
if (dataValue.includes(queryValue))
|
|
326
327
|
queryStatus = true
|
|
327
328
|
break;
|
|
@@ -450,10 +451,11 @@
|
|
|
450
451
|
if (name) {
|
|
451
452
|
try {
|
|
452
453
|
data.sort((a, b) => {
|
|
453
|
-
if (sort[i].direction == '
|
|
454
|
+
if (sort[i].direction == 'desc') {
|
|
454
455
|
switch (typeof b[name]) {
|
|
455
456
|
case 'string':
|
|
456
|
-
if (!b[name])
|
|
457
|
+
if (!b[name])
|
|
458
|
+
b[name] = ""
|
|
457
459
|
return b[name].localeCompare(a[name])
|
|
458
460
|
case 'number':
|
|
459
461
|
return b[name] - a[name]
|
|
@@ -464,7 +466,8 @@
|
|
|
464
466
|
} else {
|
|
465
467
|
switch (typeof a[name]) {
|
|
466
468
|
case 'string':
|
|
467
|
-
if (!a[name])
|
|
469
|
+
if (!a[name])
|
|
470
|
+
a[name] = ""
|
|
468
471
|
return a[name].localeCompare(b[name])
|
|
469
472
|
case 'number':
|
|
470
473
|
return a[name] - b[name]
|