strapi-utils
Advanced tools
Comparing version 3.4.5 to 3.4.6
@@ -114,4 +114,12 @@ 'use strict'; | ||
return whereClauses | ||
.filter(({ value }) => !_.isNil(value)) | ||
.filter(({ value }) => !_.isNull(value)) | ||
.map(({ field, operator, value }) => { | ||
if (_.isUndefined(value)) { | ||
const err = new Error( | ||
`The value of field: '${field}', in your where filter, is undefined.` | ||
); | ||
err.status = 400; | ||
throw err; | ||
} | ||
if (BOOLEAN_OPERATORS.includes(operator)) { | ||
@@ -118,0 +126,0 @@ return { |
@@ -64,4 +64,3 @@ 'use strict'; | ||
const nextOptions = { | ||
model: strapi.getModel(relation, attribute.plugin), | ||
const baseOptions = { | ||
withPrivate, | ||
@@ -72,6 +71,19 @@ isOutput, | ||
const nextVal = Array.isArray(value) | ||
? value.map(elem => sanitizeEntity(elem, nextOptions)) | ||
: sanitizeEntity(value, nextOptions); | ||
let sanitizeFn; | ||
if (relation === '*') { | ||
sanitizeFn = entity => | ||
sanitizeEntity(entity, { | ||
model: strapi.db.getModelByGlobalId(entity.__contentType), | ||
...baseOptions, | ||
}); | ||
} else { | ||
sanitizeFn = entity => | ||
sanitizeEntity(entity, { | ||
model: strapi.getModel(relation, attribute.plugin), | ||
...baseOptions, | ||
}); | ||
} | ||
const nextVal = Array.isArray(value) ? value.map(sanitizeFn) : sanitizeFn(value); | ||
return { ...acc, [key]: nextVal }; | ||
@@ -78,0 +90,0 @@ } |
{ | ||
"name": "strapi-utils", | ||
"version": "3.4.5", | ||
"version": "3.4.6", | ||
"description": "Shared utilities for the Strapi packages", | ||
"homepage": "http://strapi.io", | ||
"homepage": "https://strapi.io", | ||
"keywords": [ | ||
@@ -27,3 +27,3 @@ "strapi", | ||
"name": "Strapi team", | ||
"url": "http://strapi.io" | ||
"url": "https://strapi.io" | ||
}, | ||
@@ -34,3 +34,3 @@ "maintainers": [ | ||
"email": "hi@strapi.io", | ||
"url": "http://strapi.io" | ||
"url": "https://strapi.io" | ||
} | ||
@@ -50,3 +50,3 @@ ], | ||
"license": "SEE LICENSE IN LICENSE", | ||
"gitHead": "4f9cc8a22cb1f48e4da7617a99984dc45d0b4a43" | ||
"gitHead": "544f98b8ee2299f5cbce91a27a2dd775c7a53dca" | ||
} |
@@ -7,3 +7,3 @@ # strapi-utils | ||
[![Build status](https://travis-ci.org/strapi/strapi-utils.svg?branch=master)](https://travis-ci.org/strapi/strapi-utils) | ||
[![Slack status](https://slack.strapi.io/badge.svg)](http://slack.strapi.io) | ||
[![Slack status](https://slack.strapi.io/badge.svg)](https://slack.strapi.io) | ||
@@ -18,4 +18,4 @@ Shared utilities between Strapi packages. | ||
- [Strapi website](http://strapi.io/) | ||
- [Strapi community on Slack](http://slack.strapi.io) | ||
- [Strapi website](https://strapi.io/) | ||
- [Strapi community on Slack](https://slack.strapi.io) | ||
- [Strapi news on Twitter](https://twitter.com/strapijs) |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 12 instances in 1 package
19
58815
23
1694