import { isR2, unlinkFromR2 } from "./r2.js";
import { unlinkFromDisk } from "./disk.js";
import { deleteFile } from "./delete-file.js";
import { getFile } from "./get-file.js";
export async function unlink(file, givenStore) {
    if (typeof file === "string") {
        file = await getFile(file);
        if (!file) {
            return;
        }
    }
    if (isR2()) {
        await unlinkFromR2(file);
    }
    else {
        await unlinkFromDisk(file);
    }
    await deleteFile(file, givenStore);
}
//# sourceMappingURL=unlink.js.map