{"version":3,"file":"collections.cjs","names":[],"sources":["../../../../src/rest/commands/delete/collections.ts"],"sourcesContent":["import type { DirectusCollection } from '../../../schema/collection.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete a collection.\n * @param collection\n * @returns\n * @throws Will throw if collection is empty\n */\nexport const deleteCollection =\n\t<Schema>(collection: DirectusCollection<Schema>['collection']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/collections/${collection}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAUa,EACH,QAER,EAAA,aAAa,EAAY,6BAA6B,CAE/C,CACN,KAAM,gBAAgB,IACtB,OAAQ,SACR"}