@strapi/utils 5.0.0-beta.7 → 5.0.0-beta.8

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/dist/index.mjs CHANGED
@@ -314,6 +314,9 @@ const isPrivateAttribute = (model, attributeName) => {
314
314
  const isScalarAttribute = (attribute) => {
315
315
  return attribute && !["media", "component", "relation", "dynamiczone"].includes(attribute.type);
316
316
  };
317
+ const getDoesAttributeRequireValidation = (attribute) => {
318
+ return attribute.required || attribute.unique || Object.prototype.hasOwnProperty.call(attribute, "max") || Object.prototype.hasOwnProperty.call(attribute, "min") || Object.prototype.hasOwnProperty.call(attribute, "maxLength") || Object.prototype.hasOwnProperty.call(attribute, "minLength");
319
+ };
317
320
  const isMediaAttribute = (attribute) => attribute?.type === "media";
318
321
  const isRelationalAttribute = (attribute) => attribute?.type === "relation";
319
322
  const HAS_RELATION_REORDERING = ["manyToMany", "manyToOne", "oneToMany"];
@@ -368,6 +371,7 @@ const contentTypes = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
368
371
  getComponentAttributes,
369
372
  getContentTypeRoutePrefix,
370
373
  getCreatorFields,
374
+ getDoesAttributeRequireValidation,
371
375
  getNonVisibleAttributes,
372
376
  getNonWritableAttributes,
373
377
  getOptions,