UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 941 B
{"version":3,"file":"check-duplicate-builder-keys.mjs","names":[],"sources":["../../../../src/libs/config/checks/check-duplicate-builder-keys.ts"],"sourcesContent":["import { translate } from \"../../i18n/index.js\";\n\nconst checkDuplicateBuilderKeys = (\n\tbuilder: \"bricks\" | \"collections\",\n\tkeys?: string[],\n) => {\n\tif (keys === undefined) return;\n\tif (keys.length === 0) return;\n\tconst uniqueKeys = [...new Set(keys)];\n\n\tconst hasDuplicates = keys.length !== uniqueKeys.length;\n\n\tif (hasDuplicates) {\n\t\tthrow new Error(\n\t\t\ttranslate(\"server:core.config.duplicate.keys\", {\n\t\t\t\tdata: { builder: builder },\n\t\t\t}),\n\t\t);\n\t}\n};\n\nexport default checkDuplicateBuilderKeys;\n"],"mappings":"qDAEA,MAAM,GACL,EACA,IACI,CAEJ,GADI,IAAS,IAAA,IACT,EAAK,SAAW,EAAG,OACvB,IAAM,EAAa,CAAC,GAAG,IAAI,IAAI,CAAI,CAAC,EAIpC,GAFsB,EAAK,SAAW,EAAW,OAGhD,MAAU,MACT,EAAU,oCAAqC,CAC9C,KAAM,CAAW,SAAQ,CAC1B,CAAC,CACF,CAEF"}