@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 1.18 kB
Source Map (JSON)
{"version":3,"file":"check-repeater-depth.mjs","names":["constants"],"sources":["../../../../src/libs/config/checks/check-repeater-depth.ts"],"sourcesContent":["import constants from \"../../../constants/constants.js\";\nimport { translate } from \"../../i18n/index.js\";\n\nconst checkRepeaterDepth = (\n\ttype: \"brick\" | \"collection\",\n\ttypeKey: string,\n\trepeaterDepth: Record<string, number>,\n) => {\n\tfor (const [repeaterKey, depth] of Object.entries(repeaterDepth)) {\n\t\tif (depth > constants.fieldBuiler.maxRepeaterDepth) {\n\t\t\tthrow new Error(\n\t\t\t\ttranslate(\"server:core.fields.repeater.validation.depth.message\", {\n\t\t\t\t\tdata: {\n\t\t\t\t\t\ttype: type,\n\t\t\t\t\t\ttypeKey: typeKey,\n\t\t\t\t\t\trepeaterKey: repeaterKey,\n\t\t\t\t\t\tdepth: depth,\n\t\t\t\t\t\tmaxRepeaterDepth: constants.fieldBuiler.maxRepeaterDepth,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t}\n};\n\nexport default checkRepeaterDepth;\n"],"mappings":"qGAGA,MAAM,GACL,EACA,EACA,IACI,CACJ,IAAK,GAAM,CAAC,EAAa,KAAU,OAAO,QAAQ,CAAa,EAC9D,GAAI,EAAQA,EAAU,YAAY,iBACjC,MAAU,MACT,EAAU,uDAAwD,CACjE,KAAM,CACC,OACG,UACI,cACN,QACP,iBAAkBA,EAAU,YAAY,gBACzC,CACD,CAAC,CACF,CAGH"}