Socket
Socket
Sign inDemoInstall

strapi-utils

Package Overview
Dependencies
6
Maintainers
8
Versions
282
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.5.0-next.2 to 3.5.0-next.3

22

lib/sanitize-entity.js

@@ -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.5.0-next.2",
"version": "3.5.0-next.3",
"description": "Shared utilities for the Strapi packages",

@@ -48,3 +48,3 @@ "homepage": "https://strapi.io",

"license": "SEE LICENSE IN LICENSE",
"gitHead": "fe695e98219eb035a741a1baeb3334b561c81728"
"gitHead": "7102ebbcef1716b55f8a2ce8370f2cb1bd719a8a"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc