import { isR2, saveToR2 } from "./r2.js";
import { saveToDisk } from "./disk.js";
import { setFile } from "./set-file.js";
export async function save(file, contents, store) {
    const update = await saveTo();
    return setFile({
        ...file,
        ...update,
    }, store);
    async function saveTo() {
        if (isR2()) {
            return await saveToR2(file, contents);
        }
        else {
            return await saveToDisk(file, contents);
        }
    }
}
//# sourceMappingURL=save.js.map