@strapi/utils 4.2.0-alpha.O → 4.2.0-beta.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.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Converts the standard Strapi REST query params to a more usable format for querying
|
|
5
5
|
* You can read more here: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html#filters
|
|
6
6
|
*/
|
|
7
|
-
const { has, isEmpty, isObject, cloneDeep, get } = require('lodash/fp');
|
|
7
|
+
const { has, isEmpty, isObject, isPlainObject, cloneDeep, get } = require('lodash/fp');
|
|
8
8
|
const _ = require('lodash');
|
|
9
9
|
const parseType = require('./parse-type');
|
|
10
10
|
const contentTypesUtils = require('./content-types');
|
|
@@ -286,7 +286,7 @@ const convertFiltersQueryParams = (filters, schema) => {
|
|
|
286
286
|
};
|
|
287
287
|
|
|
288
288
|
const convertAndSanitizeFilters = (filters, schema) => {
|
|
289
|
-
if (!
|
|
289
|
+
if (!isPlainObject(filters)) {
|
|
290
290
|
return filters;
|
|
291
291
|
}
|
|
292
292
|
|
|
@@ -349,7 +349,7 @@ const convertAndSanitizeFilters = (filters, schema) => {
|
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
// Remove empty objects & arrays
|
|
352
|
-
if (
|
|
352
|
+
if (isPlainObject(filters[key]) && isEmpty(filters[key])) {
|
|
353
353
|
removeOperator(key);
|
|
354
354
|
}
|
|
355
355
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/utils",
|
|
3
|
-
"version": "4.2.0-
|
|
3
|
+
"version": "4.2.0-beta.0",
|
|
4
4
|
"description": "Shared utilities for the Strapi packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"node": ">=12.22.0 <=16.x.x",
|
|
46
46
|
"npm": ">=6.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "db70f0de7cc73fb469c8a076b89530729cf14142"
|
|
49
49
|
}
|