UNPKG

@lucidcms/core

Version:

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

1 lines 819 B
{"version":3,"file":"extract-collection-key.mjs","names":["constants"],"sources":["../../../../src/libs/collection/helpers/extract-collection-key.ts"],"sourcesContent":["import constants from \"../../../constants/constants.js\";\nimport type { LucidDocumentTableName } from \"../../../types.js\";\nimport { collectionTableParts } from \"./table-parts.js\";\n\n/**\n * Extracts the collection key from a LucidDocumentTableName table\n */\nconst extractCollectionKey = (table: LucidDocumentTableName) => {\n\treturn table\n\t\t.split(`${constants.db.prefix}${collectionTableParts.document}`)[1]\n\t\t?.replaceAll(constants.db.nameSeparator, \"\");\n};\n\nexport default extractCollectionKey;\n"],"mappings":"yGAOA,MAAM,EAAwB,GACtB,EACL,MAAM,GAAGA,EAAU,GAAG,SAAS,EAAqB,UAAU,CAAC,CAAC,EAAE,EACjE,WAAWA,EAAU,GAAG,cAAe,EAAE"}