{"version":3,"file":"copy.mjs","names":["copyFilePromise","copyFile"],"sources":["../../../../../../@warlock.js/fs/src/copy.ts"],"sourcesContent":["import { cp, copyFile as copyFilePromise, mkdir } from \"node:fs/promises\";\nimport { copyFileSync, cpSync, mkdirSync } from \"node:fs\";\nimport path from \"node:path\";\n\n/**\n * Copy a single file. Creates the destination's parent directory if needed.\n */\nexport async function copyFileAsync(source: string, destination: string): Promise<void> {\n  await mkdir(path.dirname(destination), { recursive: true });\n  await copyFilePromise(source, destination);\n}\n\nexport function copyFile(source: string, destination: string): void {\n  mkdirSync(path.dirname(destination), { recursive: true });\n  copyFileSync(source, destination);\n}\n\n/**\n * Recursively copy a directory.\n */\nexport async function copyDirectoryAsync(source: string, destination: string): Promise<void> {\n  await cp(source, destination, { recursive: true });\n}\n\nexport function copyDirectory(source: string, destination: string): void {\n  cpSync(source, destination, { recursive: true });\n}\n"],"mappings":";;;;;;;;AAOA,eAAsB,cAAc,QAAgB,aAAoC;CACtF,MAAM,MAAM,KAAK,QAAQ,WAAW,GAAG,EAAE,WAAW,KAAK,CAAC;CAC1D,MAAMA,SAAgB,QAAQ,WAAW;AAC3C;AAEA,SAAgBC,WAAS,QAAgB,aAA2B;CAClE,UAAU,KAAK,QAAQ,WAAW,GAAG,EAAE,WAAW,KAAK,CAAC;CACxD,aAAa,QAAQ,WAAW;AAClC;;;;AAKA,eAAsB,mBAAmB,QAAgB,aAAoC;CAC3F,MAAM,GAAG,QAAQ,aAAa,EAAE,WAAW,KAAK,CAAC;AACnD;AAEA,SAAgB,cAAc,QAAgB,aAA2B;CACvE,OAAO,QAAQ,aAAa,EAAE,WAAW,KAAK,CAAC;AACjD"}