@strapi/utils
Version:
Shared utilities for the Strapi packages
1 lines • 926 B
Source Map (JSON)
{"version":3,"file":"remove-private.mjs","sources":["../../../src/sanitize/visitors/remove-private.ts"],"sourcesContent":["import { isPrivateAttribute } from '../../content-types';\nimport type { Visitor } from '../../traverse/factory';\n\nconst visitor: Visitor = ({ schema, key, attribute }, { remove }) => {\n if (!attribute) {\n return;\n }\n\n const isPrivate = attribute.private === true || isPrivateAttribute(schema, key);\n\n if (isPrivate) {\n remove(key);\n }\n};\n\nexport default visitor;\n"],"names":["visitor","schema","key","attribute","remove","isPrivate","private","isPrivateAttribute"],"mappings":";;AAGA,MAAMA,OAAmB,GAAA,CAAC,EAAEC,MAAM,EAAEC,GAAG,EAAEC,SAAS,EAAE,EAAE,EAAEC,MAAM,EAAE,GAAA;AAC9D,IAAA,IAAI,CAACD,SAAW,EAAA;AACd,QAAA;AACF;AAEA,IAAA,MAAME,YAAYF,SAAUG,CAAAA,OAAO,KAAK,IAAA,IAAQC,mBAAmBN,MAAQC,EAAAA,GAAAA,CAAAA;AAE3E,IAAA,IAAIG,SAAW,EAAA;QACbD,MAAOF,CAAAA,GAAAA,CAAAA;AACT;AACF;;;;"}