@cocreate/utils
Advanced tools
Comparing version 1.16.1 to 1.16.2
@@ -0,1 +1,9 @@ | ||
## [1.16.2](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.16.1...v1.16.2) (2022-12-13) | ||
### Bug Fixes | ||
* query operator includes and $includes ([c3cbafe](https://github.com/CoCreate-app/CoCreate-utils/commit/c3cbafe2751387de0a8a28cd0bb284eb19ce651d)) | ||
* sort direction uses key word asc desc ([87870b0](https://github.com/CoCreate-app/CoCreate-utils/commit/87870b005720d4d723fb194a5c876acd1b6f1c41)) | ||
## [1.16.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.16.0...v1.16.1) (2022-12-12) | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "@cocreate/utils", | ||
"version": "1.16.1", | ||
"version": "1.16.2", | ||
"description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -325,2 +325,3 @@ (function (root, factory) { | ||
case '$includes': | ||
case 'includes': | ||
if (dataValue.includes(queryValue)) | ||
@@ -454,6 +455,7 @@ queryStatus = true | ||
data.sort((a, b) => { | ||
if (sort[i].direction == '-1') { | ||
if (sort[i].direction == 'desc') { | ||
switch (typeof b[name]) { | ||
case 'string': | ||
if (!b[name]) b[name] = "" | ||
if (!b[name]) | ||
b[name] = "" | ||
return b[name].localeCompare(a[name]) | ||
@@ -469,3 +471,4 @@ case 'number': | ||
case 'string': | ||
if (!a[name]) a[name] = "" | ||
if (!a[name]) | ||
a[name] = "" | ||
return a[name].localeCompare(b[name]) | ||
@@ -472,0 +475,0 @@ case 'number': |
101536
1099