2023-05-06 15:16:53 -07:00
|
|
|
import initialCart from "./initialCart.json" assert { type: "json" };
|
2023-05-05 14:59:52 -07:00
|
|
|
import { Sheet } from "./sheet.ts";
|
2023-05-02 17:06:54 -07:00
|
|
|
|
2023-05-06 15:16:53 -07:00
|
|
|
let cart = initialCart as Array<Sheet>;
|
2023-05-02 17:06:54 -07:00
|
|
|
|
2023-05-06 15:12:42 -07:00
|
|
|
export const saveCart = async (fname: string) => {
|
|
|
|
await Deno.writeTextFile("./carts/"+fname+".fx", JSON.stringify(getCart()));
|
|
|
|
}
|
|
|
|
|
|
|
|
export const loadCart = async (fname: string) => {
|
|
|
|
cart = JSON.parse(await Deno.readTextFile("./carts/"+fname+".fx"));
|
2023-05-02 17:06:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export const getCart = () => {
|
|
|
|
return cart;
|
|
|
|
}
|