Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
1.3 KiB
Plaintext
1 line
1.3 KiB
Plaintext
{"version":3,"sources":["../../../src/collections/operations/duplicate.ts"],"sourcesContent":["import type { DeepPartial } from 'ts-essentials'\n\nimport type { CollectionSlug } from '../../index.js'\nimport type { TransformCollectionWithSelect } from '../../types/index.js'\nimport type { RequiredDataFromCollectionSlug, SelectFromCollectionSlug } from '../config/types.js'\n\nimport { type Arguments as CreateArguments, createOperation } from './create.js'\n\nexport type Arguments<TSlug extends CollectionSlug> = {\n data?: DeepPartial<RequiredDataFromCollectionSlug<TSlug>>\n id: number | string\n} & Omit<CreateArguments<TSlug>, 'data' | 'duplicateFromID'>\n\nexport const duplicateOperation = async <\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n incomingArgs: Arguments<TSlug>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> => {\n const { id, ...args } = incomingArgs\n return createOperation({\n ...args,\n data: incomingArgs?.data || {},\n duplicateFromID: id,\n })\n}\n"],"names":["createOperation","duplicateOperation","incomingArgs","id","args","data","duplicateFromID"],"mappings":"AAMA,SAA4CA,eAAe,QAAQ,cAAa;AAOhF,OAAO,MAAMC,qBAAqB,OAIhCC;IAEA,MAAM,EAAEC,EAAE,EAAE,GAAGC,MAAM,GAAGF;IACxB,OAAOF,gBAAgB;QACrB,GAAGI,IAAI;QACPC,MAAMH,cAAcG,QAAQ,CAAC;QAC7BC,iBAAiBH;IACnB;AACF,EAAC"} |