MCPcopy
hub / github.com/tldraw/tldraw / duplicate

Function duplicate

packages/dotcom-shared/src/mutators.test.ts:1473–1481  ·  view source on GitHub ↗
(m: ReturnType<typeof createMutators>, tx: any, createSource: string | null)

Source from the content-addressed store, hash-verified

1471 }
1472
1473 function duplicate(m: ReturnType<typeof createMutators>, tx: any, createSource: string | null) {
1474 return m.createFile(tx, {
1475 fileId: newFileId,
1476 workspaceId: userId,
1477 name: 'Copy',
1478 time: Date.now(),
1479 createSource,
1480 })
1481 }
1482
1483 it('can duplicate a file shared with you', async () => {
1484 const s = baseStore(makeFile({ id: sourceId, owningGroupId: otherGroup, shared: true }))

Callers 1

mutators.test.tsFile · 0.85

Calls 2

createFileMethod · 0.80
nowMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…